1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/tk/lib/tk/menu.rb: TkOptionMenubutton.new fails to treat

'parent' and 'variable' options on a Hash argument.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagai 2008-12-03 21:03:49 +00:00
parent 57746bb6fa
commit 694fab958c

View file

@ -569,7 +569,7 @@ class Tk::OptionMenubutton<Tk::Menubutton
keys = _symbolkey2str(keys)
parent = nil
if args[0].kind_of?(TkWindow) || args[0] == nil
if !args.empty? && (args[0].kind_of?(TkWindow) || args[0] == nil)
keys.delete('parent') # ignore
parent = args.shift
else
@ -577,7 +577,7 @@ class Tk::OptionMenubutton<Tk::Menubutton
end
@variable = nil
if args[0].kind_of?(TkVariable) || args[0] == nil
if !args.empty? && (args[0].kind_of?(TkVariable) || args[0] == nil)
keys.delete('variable') # ignore
@variable = args.shift
else