3

I would like to write an application in Ruby using Qt which will communicate over the network with other instances.

How can I integrate Qt's event loop with DRb or EventMachine?

EDIT:

I found the answer when I will have more time I will post it

denysonique
  • 16,235
  • 6
  • 37
  • 40

1 Answers1

6
require 'eventmachine'
require 'Qt4'

app = Qt::Application.new(ARGV)
hello_button = Qt::PushButton.new("Hello EventMachine")
hello_button.resize(100,20)
hello_button.show

EventMachine.run do
  EM.add_periodic_timer(0.01) do
    app.process_events
  end
end
denysonique
  • 16,235
  • 6
  • 37
  • 40