* TkRoot and TkToplevel : bug fix


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagai 2003-06-23 14:22:44 +00:00
parent d061e2aab7
commit 65e7ebb14f

View File

@ -1174,8 +1174,8 @@ module Tk
procedure(tk_call('wm', 'command', path)) procedure(tk_call('wm', 'command', path))
end end
end end
def deiconify def deiconify(ex = true)
tk_call 'wm', 'deiconify', path tk_call('wm', 'deiconify', path) if ex
self self
end end
def focusmodel(mode = nil) def focusmodel(mode = nil)
@ -1221,8 +1221,8 @@ module Tk
tk_call 'wm', 'iconbitmap', path tk_call 'wm', 'iconbitmap', path
end end
end end
def iconify def iconify(ex = true)
tk_call 'wm', 'iconify', path tk_call('wm', 'iconify', path) if ex
self self
end end
def iconmask(bmp=nil) def iconmask(bmp=nil)
@ -1351,8 +1351,8 @@ module Tk
window(tk_call('wm', 'transient', path, master)) window(tk_call('wm', 'transient', path, master))
end end
end end
def withdraw def withdraw(ex = true)
tk_call 'wm', 'withdraw', path tk_call('wm', 'withdraw', path) if ex
self self
end end
end end
@ -3544,7 +3544,15 @@ class TkRoot<TkWindow
return ROOT[0] return ROOT[0]
end end
new = super(:without_creating=>true, :widgetname=>'.') 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 ROOT[0] = new
Tk_WINDOWS["."] = new Tk_WINDOWS["."] = new
end end
@ -3599,6 +3607,7 @@ class TkToplevel<TkWindow
################# #################
def _wm_command_option_chk(keys) def _wm_command_option_chk(keys)
keys = {} unless keys
new_keys = {} new_keys = {}
wm_cmds = {} wm_cmds = {}
keys.each{|k,v| keys.each{|k,v|
@ -3643,7 +3652,13 @@ class TkToplevel<TkWindow
end end
keys, cmds = _wm_command_option_chk(keys) keys, cmds = _wm_command_option_chk(keys)
super(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 return
end end
if screen.kind_of? Hash if screen.kind_of? Hash