How to do multithreading with Shoes? Shoes.app blocks

78 views Asked by At

After quite some headache, I realized that the Shoes.app call blocks the execution of further code. I tried wrapping it in Thread.new but then the window doesn't get displayed. How can I launch a window and manipulate it from the outside?

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")

I originally thought the problem was me incorrectly saving and handling app or it's variables inside the block, since there is a special line about it in the manual (http://shoesrb.com/manual/Rules.html on Block Redirection) and what I did outside of the block didn't change the window. In my opinion, the manual is not very clear on blocking.

0

There are 0 answers