root/lang/ruby/misc/yhara/yhara_shoes.rb
@
39139
| Revision 4188, 310 bytes (checked in by nanki, 5 years ago) |
|---|
| Line | |
|---|---|
| 1 | def say(v) |
| 2 | Thread.new{`say #{v}`} |
| 3 | end |
| 4 | |
| 5 | Shoes.app do |
| 6 | stack do |
| 7 | caption "Click buttons or type j or k." |
| 8 | |
| 9 | flow do |
| 10 | %w(y hara).each do |v| |
| 11 | button(v){say v} |
| 12 | end |
| 13 | end |
| 14 | end |
| 15 | |
| 16 | keypress do |key| |
| 17 | case key |
| 18 | when 'j' |
| 19 | say 'y' |
| 20 | when 'k' |
| 21 | say 'hara' |
| 22 | end |
| 23 | end |
| 24 | end |
Note: See TracBrowser
for help on using the browser.
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)