summaryrefslogtreecommitdiffstats
path: root/ext/tk/lib
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-03 21:03:49 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-03 21:03:49 +0000
commit2aefc2f6b2a6515023ecf367ce346ac9b74f8e1b (patch)
treeb097ad80c491e930881049027bf1df2d1cfa13a1 /ext/tk/lib
parent35b0002cc368179cdd695205102770cb3f133ba6 (diff)
downloadruby-2aefc2f6b2a6515023ecf367ce346ac9b74f8e1b.tar.gz
ruby-2aefc2f6b2a6515023ecf367ce346ac9b74f8e1b.tar.xz
ruby-2aefc2f6b2a6515023ecf367ce346ac9b74f8e1b.zip
* ext/tk/lib/tk/menu.rb: TkOptionMenubutton.new fails to treat
'parent' and 'variable' options on a Hash argument. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib')
-rw-r--r--ext/tk/lib/tk/menu.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/tk/lib/tk/menu.rb b/ext/tk/lib/tk/menu.rb
index 3ae0548dd..0e4f419e1 100644
--- a/ext/tk/lib/tk/menu.rb
+++ b/ext/tk/lib/tk/menu.rb
@@ -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