From eb6571a860ff8c37c3583145be57287e8af97533 Mon Sep 17 00:00:00 2001 From: nagai Date: Tue, 6 Jul 2004 09:42:12 +0000 Subject: * ext/tk/lib : improve framework of developping Tcl/Tk extension wrappers * BWidget extension support on Ruby/Tk git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/lib/tk/wm.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ext/tk/lib/tk/wm.rb') diff --git a/ext/tk/lib/tk/wm.rb b/ext/tk/lib/tk/wm.rb index 2467656837..b5106adade 100644 --- a/ext/tk/lib/tk/wm.rb +++ b/ext/tk/lib/tk/wm.rb @@ -178,10 +178,13 @@ module Tk self end end - def protocol(name=nil, cmd=nil) + def protocol(name=nil, cmd=nil, &b) if cmd tk_call_without_enc('wm', 'protocol', path, name, cmd) self + elsif b + tk_call_without_enc('wm', 'protocol', path, name, proc(&b)) + self elsif name result = tk_call_without_enc('wm', 'protocol', path, name) (result == "")? nil : tk_tcl2ruby(result) -- cgit v1.2.3