Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2011
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.63 KB | None | 0 0
  1.         def start client
  2.             app = Qt::Application.new ['main.rb']
  3.  
  4.             socket = client.connect
  5.             notif = Qt::SocketNotifier.new socket.fileno, Qt::SocketNotifier::Read
  6.  
  7.             main = MainWindow.new
  8.  
  9.             notif.connect SIGNAL('activated(int)') do
  10.                 notif.enabled = false
  11.                 data = client.read
  12.                 main.append_message data
  13.                 notif.enabled = true
  14.             end
  15.  
  16.             main.connect SIGNAL('send_input(QString)') do |msg|
  17.                 client.write msg
  18.             end
  19.  
  20.             main.show
  21.             app.exec
  22.         end
  23.  
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement