我开始用Shoes编写GUI代码.我从示例中尝试了进度条,但是我发现无法退出动画,break没有工作......
animate do |frames|
unless frames > 100
@p.fraction = (frames % 100) / 100.0
else
break
end
end
Run Code Online (Sandbox Code Playgroud)
有没有可能用鞋停止动画?谢谢.
当然,停止这样做
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
end
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
757 次 |
| 最近记录: |