QtRuby with DRb or EventMachine
I would like to write an application in Ruby using Qt which will communicate ov开发者_开发问答er 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
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
精彩评论