summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-04 08:55:38 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-04 08:55:38 +0000
commitce5802488f0cb4f0ff1006a8f285293af8696e32 (patch)
tree3c07c2ca87f84ca568b2858099ad763fe7559ebc /ext
parent638d844b1c33b27ca7610fee61ba90744710e9b2 (diff)
merges r20476 and r20479 from trunk into ruby_1_9_1.
* 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/branches/ruby_1_9_1@20504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-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 3ae0548dd1..0e4f419e15 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