Skip to content

Commit

Permalink
* ext/tk/lib/tk/menuspec.rb: option check will fail when
Browse files Browse the repository at this point in the history
  TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ is true.

* ext/tk/lib/tk/palette.rb: bug fix.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nagai committed Apr 15, 2008
1 parent b54786f commit ea81398
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Tue Apr 15 16:58:55 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>

* ext/tk/lib/tk/menuspec.rb: option check will fail when
TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ is true.

* ext/tk/lib/tk/palette.rb: bug fix.

Tue Apr 15 16:47:48 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>

* signal.c, gc.c: New methods: GC.stress, GC.stress=;
Expand Down
2 changes: 1 addition & 1 deletion ext/tk/lib/tk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5341,7 +5341,7 @@ def bindtags_unshift(tag)
#Tk.freeze

module Tk
RELEASE_DATE = '2008-04-13'.freeze
RELEASE_DATE = '2008-04-15'.freeze

autoload :AUTO_PATH, 'tk/variable'
autoload :TCL_PACKAGE_PATH, 'tk/variable'
Expand Down
14 changes: 5 additions & 9 deletions ext/tk/lib/tk/menuspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,23 +155,20 @@ def _create_menu(parent, menu_info, menu_name = nil,
def _use_menubar?(parent)
use_menubar = false
if parent.kind_of?(Tk::Root) || parent.kind_of?(Tk::Toplevel)
return true
true
elsif parent.current_configinfo.has_key?('menu')
true
else
begin
parent.cget('menu')
return true
rescue
end
false
end
false
end
private :_use_menubar?

def _create_menu_for_menubar(parent)
#unless (mbar = parent.menu).kind_of?(TkMenu)
# --> use current TkMenu class
mbar = parent.menu
unless parent.menu.kind_of?(Tk::Menu) || parent.menu.kind_of?(TkMenu)
unless mbar.kind_of?(Tk::Menu) || mbar.kind_of?(TkMenu)
#mbar = Tk::Menu.new(parent, :tearoff=>false)
mbar = TkMenu.new(parent, :tearoff=>false)
parent.menu(mbar)
Expand All @@ -198,7 +195,6 @@ def _create_menubutton(parent, menu_info, tearoff=false, default_opts = nil)

if _use_menubar?(parent)
# menubar by menu entries

mbar = _create_menu_for_menubar(parent)

menu_name = nil
Expand Down
2 changes: 1 addition & 1 deletion ext/tk/lib/tk/palette.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module TkPalette
].freeze

def TkPalette.set(*args)
args = args.to_a.flatten if args.kind_of? Hash
args = args[0].to_a.flatten if args[0].kind_of? Hash
tk_call('tk_setPalette', *args)
end
def TkPalette.setPalette(*args)
Expand Down

0 comments on commit ea81398

Please sign in to comment.