summaryrefslogtreecommitdiff
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
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
-rw-r--r--ChangeLog5
-rw-r--r--ext/tk/lib/tk/menu.rb4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 879f5de57f..4f6d1c2f83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Dec 4 06:04:16 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/tk/menu.rb: TkOptionMenubutton.new fails to treat
+ 'parent' and 'variable' options on a Hash argument.
+
Thu Dec 4 05:06:47 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb: bug fix. use ::RubyVM instead of ::VM
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