summaryrefslogtreecommitdiff
path: root/ext/gtk/test5.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gtk/test5.rb')
-rw-r--r--ext/gtk/test5.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/gtk/test5.rb b/ext/gtk/test5.rb
index 714232079b..f1d5d734cf 100644
--- a/ext/gtk/test5.rb
+++ b/ext/gtk/test5.rb
@@ -21,10 +21,11 @@ button = []
end
0.upto(8) do |i|
button[i].signal_connect("clicked") do |w|
- if button[i+1].visible?
- button[i+1].hide
+ j = (i+1)%9
+ if button[j].visible?
+ button[j].hide
else
- button[i+1].show
+ button[j].show
end
end
button[i].show