如何用鞋子进行多线程处理? Shoes.app块

时间:2017-03-27 21:54:07

标签: ruby shoes shoes-4

经过一番头疼之后,我意识到Shoes.app调用会阻止执行更多代码。我尝试将其包装在Thread.new中,但随后窗口无法显示。如何启动窗口并从外部操作它?

require 'shoes'

app = Shoes.app do
  para "I block the execution."
  button "I've seen enough" do
     exit
  end
end

print("Called when the window terminates")

我原本以为问题是我错误地保存并处理了块中的app或它的变量,因为手册中有一个特殊的行(块重定向为http://shoesrb.com/manual/Rules.html)而我是什么在街区外没有改变窗户。在我看来,手册在封锁方面不是很清楚。

0 个答案:

没有答案