Hello, first time poster here and novice shoer.

I was wondering if there is a way to interrupt animate() from inside its
code block. If I write it without threads, it will just loop forever and
keep the program from going further.
I need to have a progress bar that will fill up and then to end the
animation and call another view using visit().

Here is an abortive threading attempt that now only seems to run the b
thread, which kills the process.

Shoes.app do
  a = Thread.new {
    stack do
      title "Progress example"
      p = progress :width => 0.5
      animate(120) do |i|
        p.fraction = (i % 100) / 100.0
      end
    end
    Thread.stop
  }

  b = Thread.new {
    sleep 4
    exit
  }

  a.join
  b.join
end

Reply via email to