summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-23 14:22:44 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-23 14:22:44 +0000
commit65e7ebb14fde52fee2cd08f38f467adbd4fe6e25 (patch)
treeaa910b034bbad71c9ee0fa5f1b07ae01262ffa6e /ext
parentd061e2aab748052bcdec92fe73920c94b4a0312f (diff)
tk.rb :
* TkRoot and TkToplevel : bug fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/tk/lib/tk.rb31
1 files changed, 23 insertions, 8 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index f1226ba10f..dabc78753c 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -1174,8 +1174,8 @@ module Tk
procedure(tk_call('wm', 'command', path))
end
end
- def deiconify
- tk_call 'wm', 'deiconify', path
+ def deiconify(ex = true)
+ tk_call('wm', 'deiconify', path) if ex
self
end
def focusmodel(mode = nil)
@@ -1221,8 +1221,8 @@ module Tk
tk_call 'wm', 'iconbitmap', path
end
end
- def iconify
- tk_call 'wm', 'iconify', path
+ def iconify(ex = true)
+ tk_call('wm', 'iconify', path) if ex
self
end
def iconmask(bmp=nil)
@@ -1351,8 +1351,8 @@ module Tk
window(tk_call('wm', 'transient', path, master))
end
end
- def withdraw
- tk_call 'wm', 'withdraw', path
+ def withdraw(ex = true)
+ tk_call('wm', 'withdraw', path) if ex
self
end
end
@@ -3544,7 +3544,15 @@ class TkRoot<TkWindow
return ROOT[0]
end
new = super(:without_creating=>true, :widgetname=>'.')
- keys.each{|k,v| new.send(k,v)} if keys # wm commands
+ if keys # wm commands
+ keys.each{|k,v|
+ if v.kind_of? Array
+ new.send(k,*v)
+ else
+ new.send(k,v)
+ end
+ }
+ end
ROOT[0] = new
Tk_WINDOWS["."] = new
end
@@ -3599,6 +3607,7 @@ class TkToplevel<TkWindow
#################
def _wm_command_option_chk(keys)
+ keys = {} unless keys
new_keys = {}
wm_cmds = {}
keys.each{|k,v|
@@ -3643,7 +3652,13 @@ class TkToplevel<TkWindow
end
keys, cmds = _wm_command_option_chk(keys)
super(keys)
- cmds.each{|k,v| self.send(k,v)}
+ cmds.each{|k,v|
+ if v.kind_of? Array
+ self.send(k,*v)
+ else
+ self.send(k,v)
+ end
+ }
return
end
if screen.kind_of? Hash