aboutsummaryrefslogtreecommitdiffstats
path: root/ext/tk/sample/remote-ip_sample2.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-17 06:05:33 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-17 06:05:33 +0000
commit27859754890e5562b33ffbb4b89e9f3c9c68df97 (patch)
tree0ce1499a52070710055a797c5a78c69bf386ad24 /ext/tk/sample/remote-ip_sample2.rb
parent2ce5bb2594fbd6250b60fc9dd49d7735668fa8fa (diff)
downloadruby-27859754890e5562b33ffbb4b89e9f3c9c68df97.tar.gz
* ext/tcltklib/tcltklib.c: fix SEGV when (thread_)vwait or (thread_)tkwait
* ext/tk/lib/tk.rb: add alias wait_window to wait_destroy * ext/tk/lib/multi-tk.rb: support calling 'mainloop' on slave interpreters (however, the 'real' eventloop must be run on the Default Master IP) * ext/tk/lib/remote-tk.rb: follow the changes of ext/tk/lib/multi-tk.rb * ext/tk/sample/remote-ip_sample2.rb: ditto * ext/tk/sample/tkoptdb-safeTk.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/remote-ip_sample2.rb')
-rw-r--r--ext/tk/sample/remote-ip_sample2.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/tk/sample/remote-ip_sample2.rb b/ext/tk/sample/remote-ip_sample2.rb
index fcc34b73de..cc7f424489 100644
--- a/ext/tk/sample/remote-ip_sample2.rb
+++ b/ext/tk/sample/remote-ip_sample2.rb
@@ -40,8 +40,11 @@ ip.eval_proc{
}
# setup controller-ip window
-btns.each_with_index{|b, idx|
- TkButton.new(:command=>proc{ip.eval_proc{b.flash}},
+btns.each_with_index{|btn, idx|
+ # The scope of the eval-block of 'eval_proc' method is different from
+ # the enternal. If you want to pass local values to the eval-block,
+ # use arguments of eval_proc method. They are passed to block-arguments.
+ TkButton.new(:command=>proc{ip.eval_proc(btn){|b| b.flash}},
:text=>"flash button-#{idx}",
:padx=>10).pack(:padx=>10, :pady=>2)
}