On Thu, Sep 18, 2008 at 05:00:23PM -0400, Dean Mehinovic wrote:
> 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.
You can use Animation.stop.
Shoes.app do
stack do
title "Progress example"
p = progress :width => 0.5
@anim = animate(120) do |i|
p.fraction = i * 0.01
@anim.stop if i == 100
end
end
end
See the "Timers" section of the manual.
<http://help.shoooes.net/Timers.html>
_why