开发者

QtRuby with DRb or EventMachine

开发者 https://www.devze.com 2023-03-18 10:54 出处:网络
I would like to write an application in Ruby using Qt which will communicate ov开发者_开发问答er the network with other instances.

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

精彩评论

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