为我工作。试试这个:复制
minimal
从wxruby分布中采样,并修改
minimal.rb
以便在wx主循环之前启动msn线程:
require 'msn/msn'
conn = MSNConnection.new("rubybot@channelwood.org", "secretpassword123")
conn.start
# Wx::App is the container class for any wxruby app. To start an
# application, either define a subclass of Wx::App, create an instance,
# and call its main_loop method, OR, simply call the Wx::App.run class
# method, as shown here.
Wx::App.run do
self.app_name = 'Minimal'
frame = MinimalFrame.new("Minimal wxRuby App")
frame.show
end
您需要将
msn
目录
极小值
当然,要使REQUEST语句工作的目录。
你不需要
while true {sleep 1}
循环;这只是为了防止程序退出,以便您的msn线程可以继续运行。WX主循环实现相同的目的。