From 31b2baaefe1f6a00639e57a436c40beee793933d Mon Sep 17 00:00:00 2001 From: nagai Date: Thu, 4 Aug 2005 09:41:34 +0000 Subject: * ext/tcltklib/tcltklib.c: cannot compile for Tcl7.6/Tk4.2. * ext/tcltklib/tcltklib.c: add nativethread consistency check. * ext/tcltklib/stubs.c: ditto. * ext/tk/lib/tk.rb: forgot to define TclTkIp.encoding and encoding= when Tcl is 7.6 or 8.0. * ext/tk/lib/tk/wm.rb: support to make some methods as options of root or toplevel widget. [ruby-talk:150336] * ext/tk/lib/tk/root.rb: ditto. * ext/tk/lib/tk/toplevel.rb: ditto. * ext/tk/lib/tkextlib/SUPPRT_STATUS: update RELEASE_DATE git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/lib/tk/root.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'ext/tk/lib/tk/root.rb') diff --git a/ext/tk/lib/tk/root.rb b/ext/tk/lib/tk/root.rb index dd5f52ca82..0e5584c7c1 100644 --- a/ext/tk/lib/tk/root.rb +++ b/ext/tk/lib/tk/root.rb @@ -9,6 +9,11 @@ class TkRootmethod, ... } + TOPLEVEL_METHODCALL_OPTKEYS + end + private :__methodcall_optkeys + =begin ROOT = [] def TkRoot.new(keys=nil) @@ -36,7 +41,18 @@ class TkRoottrue, :widgetname=>'.'){} end root = TkCore::INTERP.tk_windows['.'] - if keys # wm commands + + keys = _symbolkey2str(keys) + + # wm commands + root.instance_eval{ + __methodcall_optkeys.each{|key, method| + value = keys.delete(key.to_s) + self.__send__(method, value) if value + } + } + + if keys # wm commands ( for backward comaptibility ) keys.each{|k,v| if v.kind_of? Array root.__send__(k,*v) @@ -45,6 +61,7 @@ class TkRoot