开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜