我开始用鞋子编写图形用户界面。我尝试了示例中的进度条,但我发现无法退出动画,break不起作用……
animate do |frames|
unless frames > 100
@p.fraction = (frames % 100) / 100.0
else
break
end
end有没有可能用鞋子来停止动画?谢谢。
发布于 2011-12-23 05:08:19
当然,停下来就是这样
Shoes.app do
stack :margin => 0.1 do
title "Progress example"
@p = progress :width => 1.0
@animate = animate (24) do |i|
@p.fraction = (i % 100) / 100.0
@animate.stop if i > 99
end
end
endhttps://stackoverflow.com/questions/8546544
复制相似问题