On 18.12.2008, at 01:36 , e deleflie wrote:

This works fine for me:

Shoes.app do
      Thread.new do
              loop do
                      debug "test"
                      sleep 1
              end
      end
      para "testing"
end

ah yes, too right ... I wasn't inside the Shoes self when I created
the new Thread.

...argh ... but now my variable scope is whacked!

Etienne


But even when I put the thread in another class, strangely enough, it worked.

class Outside
        
        def runTread
                Thread.new do
                        loop do
                                debug "testing"
                                sleep (rand(30)+10)/10
                        end
                end
                
        end
        
end

Shoes.app do
        Outside.new.runTread
        
        para "testing"
end

Even if I moved Outside into its own file and required it.

einarmagnus



Reply via email to