Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def start client
- app = Qt::Application.new ['main.rb']
- socket = client.connect
- notif = Qt::SocketNotifier.new socket.fileno, Qt::SocketNotifier::Read
- main = MainWindow.new
- notif.connect SIGNAL('activated(int)') do
- notif.enabled = false
- data = client.read
- main.append_message data
- notif.enabled = true
- end
- main.connect SIGNAL('send_input(QString)') do |msg|
- client.write msg
- end
- main.show
- app.exec
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement