From e6697a6405f1330ef071220396b8afef1cd1079a Mon Sep 17 00:00:00 2001 From: nagai Date: Tue, 10 Jun 2008 20:59:10 +0000 Subject: * ext/tk/tcltklib.c: SEGV when tcltk-stubs is enabled. * ext/tk/tcltklib.c: avoid error on a shared object. * ext/tk/extconf.rb: support --with-tcltkversion * ext/tk/README.tcltklib: add document about --with-tcltkversion * ext/tk/lib/tk.rb, ext/tk/lib/multi-tk.rb, ext/tk/lib/remote-tk.rb: not work on $SAFE==4 * ext/tk/lib/multi-tk.rb: Object#methods returns Symbols on Ruby1.9. * ext/tk/lib/tk/timer.rb: add TkTimer#at_end(proc) to register the procedure which called at end of the timer. * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemfont.rb, ext/tk/lib/font.rb: support __IGNORE_UNKNOWN_CONFIGURE_OPTION__ about font options. * ext/tk/lib/*: treat __IGNORE_UNKNOWN_CONFIGURE_OPTION__ * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb, ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb, ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb: bug fix. * ext/tk/lib/tk/text.rb: typo. call a wrong method. * ext/tk/lib/tk/itemconfig.rb: ditto. * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemconfig.rb, ext/tk/lib/tk/canvas.rb: support alias names of option keys. * ext/tk/lib/tk/grid.rb: lack of module-method definitions. * ext/tk/lib/tk/pack.rb, ext/tk/lib/tk/grid.rb: increase supported parameter patterns of configure method. * ext/tk/lib/tk.rb: add TkWindow#grid_anchor, grid_column, grid_row. * ext/tk/lib/tk/wm.rb: methods of Tk::Wm_for_General module cannot pass the given block to methods of Tk::Wm module. * ext/tk/lib/tk/wm.rb: Wm#overrideredirect overwrites arguemnt to an invalid value. * ext/tk/lib/tk.rb: fix memory (object) leak bug. * ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: fix memory leak. * ext/tk/sample/demos-jp/aniwave.rb, ext/tk/sample/demos-en/aniwave.rb: bug fix. * ext/tk/lib/tkextlib/blt/component.rb, ext/tk/lib/tkextlib/tile/tentry.rb, ext/tk/lib/tkextlib/tile/treeview.rb: ditto. * ext/tk/lib/tkextlib/tile/tpaned.rb: improve TPaned#add. * ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget, ext/tk/sample/demos-jp/style.rb, ext/tk/sample/demos-en/style.rb, ext/tk/sample/demos-jp/bind.rb, ext/tk/sample/demos-en/bind.rb: bug fix. * ext/tk/sample/ttk_wrapper.rb: ditto. * ext/tk/sample/ttk_wrapper.rb: support "if __FILE__ == $0" idiom. * ext/tk/sample/tktextio.rb: add binding for 'Ctrl-u' at console mode. * ext/tk/lib/tkextlib/tile.rb, ext/tk/lib/tkextlib/tile/style.rb, ext/tk/sample/ttk_wrapper.rb: improve treating and control themes. add Tk::Tile.themes and Tk::Tile.set_theme(theme). * ext/tk/lib/tkextlib/tile.rb: lack of autoload definitions. * ext/tk/lib/tkextlib/tile/tnotebook.rb: cannot use kanji (not UTF-8) characters for headings. * ext/tk/lib/tkextlib/tkDND/shape.rb: wrong package name. * ext/tk/tkutil/tkutil.c: improve handling callback-subst-keys. Now, support longnam-keys (e.g. '%CTT' on tkdnd-2.0; however, still not support tkdnd-2.0 on tkextlib), and symbols of parameters (e.g. :widget=>'%W', :keycode=>'%k', '%x'=>:x, '%X'=>:root_x, and so on; those are attributes of event object). It means that Ruby/Tk accepts not only "widget.bind(ev, '%W', '%k', ...){|w, k, ...| ... }", but also "widget.bind(ev, :widget, :keycode, ...){|w, k, ...| ... }". It is potentially incompatible, when user passes symbols to the arguments of the callback block (the block receives the symbols as strings). I think that is very rare case (probably, used by Ruby/Tk experts only). When causes such trouble, please give strings instead of such symbol parameters (e.g. call Symbol#to_s method). * ext/tk/lib/tk/event.rb, ext/tk/lib/tk/validation.rb, ext/tk/lib/tkextlib/blt/treeview.rb, ext/tk/lib/tkextlib/winico/winico.rb: ditto. * ext/tk/tkutil/tkutil.c: strings are available on subst_tables on TkUtil::CallbackSubst class (it is useful on Ruby 1.9). * ext/tk/lib/tk/spinbox.rb, ext/tk/lib/tkextlib/iwidgets/hierarchy.rb, ext/tk/lib/tkextlib/iwidgets/spinner.rb, ext/tk/lib/tkextlib/iwidgets/entryfield.rb, ext/tk/lib/tkextlib/iwidgets/calendar.rb, ext/tk/lib/tkextlib/blt/dragdrop.rb, ext/tk/lib/tkextlib/tkDND/tkdnd.rb, ext/tk/lib/tkextlib/treectrl/tktreectrl.rb, ext/tk/lib/tkextlib/tktable/tktable.rb: disable code piece became unnecessary by reason of the changes of ext/tk/tkutil/tkutil.c. * ext/tk/lib/tk.rb, ext/tk/lib/multi-tk.rb: change strategy to define the constant WITH_ENCODING. * ext/tk/lib/tk.rb: fix bug on Tk::Encoding.tk_encoding_names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/lib/tkextlib/treectrl/tktreectrl.rb | 67 ++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 4 deletions(-) (limited to 'ext/tk/lib/tkextlib/treectrl/tktreectrl.rb') diff --git a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb index b72b157dcd..e10e6e299e 100644 --- a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb +++ b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb @@ -137,6 +137,7 @@ class Tk::TreeCtrl::NotifyEvent nil ] +=begin # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) ) KEY_TBL.map!{|inf| if inf.kind_of?(Array) @@ -152,6 +153,7 @@ class Tk::TreeCtrl::NotifyEvent end inf } +=end # setup tables to be used by scan_args, _get_subst_key, _get_all_subst_keys # @@ -415,6 +417,9 @@ module Tk::TreeCtrl::ConfigMethod def column_cget(tagOrId, option) itemcget(['column', tagOrId], option) end + def column_cget_strict(tagOrId, option) + itemcget_strict(['column', tagOrId], option) + end def column_configure(tagOrId, slot, value=None) itemconfigure(['column', tagOrId], slot, value) end @@ -428,6 +433,9 @@ module Tk::TreeCtrl::ConfigMethod def column_dragcget(option) itemcget(['column', 'drag'], option) end + def column_dragcget_strict(option) + itemcget_strict(['column', 'drag'], option) + end def column_dragconfigure(slot, value=None) itemconfigure(['column', 'drag'], slot, value) end @@ -441,6 +449,9 @@ module Tk::TreeCtrl::ConfigMethod def debug_cget(option) itemcget('debug', option) end + def debug_cget_strict(option) + itemcget_strict('debug', option) + end def debug_configure(slot, value=None) itemconfigure('debug', slot, value) end @@ -454,6 +465,9 @@ module Tk::TreeCtrl::ConfigMethod def dragimage_cget(option) itemcget('dragimage', option) end + def dragimage_cget_strict(option) + itemcget_strict('dragimage', option) + end def dragimage_configure(slot, value=None) itemconfigure('dragimage', slot, value) end @@ -467,6 +481,9 @@ module Tk::TreeCtrl::ConfigMethod def element_cget(tagOrId, option) itemcget(['element', tagOrId], option) end + def element_cget_strict(tagOrId, option) + itemcget_strict(['element', tagOrId], option) + end def element_configure(tagOrId, slot, value=None) itemconfigure(['element', tagOrId], slot, value) end @@ -480,6 +497,9 @@ module Tk::TreeCtrl::ConfigMethod def item_cget(tagOrId, option) itemcget(['item', tagOrId], option) end + def item_cget_strict(tagOrId, option) + itemcget_strict(['item', tagOrId], option) + end def item_configure(tagOrId, slot, value=None) itemconfigure(['item', tagOrId], slot, value) end @@ -493,6 +513,9 @@ module Tk::TreeCtrl::ConfigMethod def item_element_cget(item, column, elem, option) itemcget([['item', 'element'], [item, column, elem]], option) end + def item_element_cget_strict(item, column, elem, option) + itemcget_strict([['item', 'element'], [item, column, elem]], option) + end def item_element_configure(item, column, elem, slot, value=None) itemconfigure([['item', 'element'], [item, column, elem]], slot, value) end @@ -506,6 +529,9 @@ module Tk::TreeCtrl::ConfigMethod def marquee_cget(option) itemcget('marquee', option) end + def marquee_cget_strict(option) + itemcget_strict('marquee', option) + end def marquee_configure(slot, value=None) itemconfigure('marquee', slot, value) end @@ -518,7 +544,19 @@ module Tk::TreeCtrl::ConfigMethod def notify_cget(win, pattern, option) pattern = "<#{pattern}>" - itemconfigure(['notify', [win, pattern]], option) + # "notify" doesn't have cget subcommand. + current_itemconfiginfo(['notify', [win, pattern]])[option.to_s] + end + def notify_cget_strict(win, pattern, option) + pattern = "<#{pattern}>" + # "notify" doesn't have cget subcommand. + info = current_itemconfiginfo(['notify', [win, pattern]]) + option = option.to_s + unless info.has_key?(option) + fail RuntimeError, "unknown option \"#{option}\"" + else + info[option] + end end def notify_configure(win, pattern, slot, value=None) pattern = "<#{pattern}>" @@ -528,11 +566,17 @@ module Tk::TreeCtrl::ConfigMethod pattern = "<#{pattern}>" itemconfiginfo(['notify', [win, pattern]], slot) end - alias current_notify_configinfo notify_configinfo + def current_notify_configinfo(tagOrId, slot=nil) + pattern = "<#{pattern}>" + current_itemconfiginfo(['notify', [win, pattern]], slot) + end def style_cget(tagOrId, option) itemcget(['style', tagOrId], option) end + def style_cget_strict(tagOrId, option) + itemcget_strict(['style', tagOrId], option) + end def style_configure(tagOrId, slot, value=None) itemconfigure(['style', tagOrId], slot, value) end @@ -543,8 +587,8 @@ module Tk::TreeCtrl::ConfigMethod current_itemconfiginfo(['style', tagOrId], slot) end - private :itemcget, :itemconfigure - private :itemconfiginfo, :current_itemconfiginfo + private :itemcget, :itemcget_strict + private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo end ############################################## @@ -1700,6 +1744,9 @@ class Tk::TreeCtrl::Column < TkObject def cget(opt) @tree.column_cget(@tree.column_index(@id), opt) end + def cget_strict(opt) + @tree.column_cget_strict(@tree.column_index(@id), opt) + end def configure(*args) @tree.column_configure(@tree.column_index(@id), *args) @@ -1800,6 +1847,9 @@ class Tk::TreeCtrl::Element < TkObject def cget(opt) @tree.element_cget(@id, opt) end + def cget_strict(opt) + @tree.element_cget_strict(@id, opt) + end def configure(*args) @tree.element_configure(@id, *args) @@ -1931,6 +1981,9 @@ class Tk::TreeCtrl::Item < TkObject def cget(opt) @tree.item_cget(@id, opt) end + def cget_strict(opt) + @tree.item_cget_strict(@id, opt) + end def configure(*args) @tree.item_configure(@id, *args) @@ -1964,6 +2017,9 @@ class Tk::TreeCtrl::Item < TkObject def element_cget(opt) @tree.item_element_cget(@id, opt) end + def element_cget_strict(opt) + @tree.item_element_cget_strict(@id, opt) + end def element_configure(*args) @tree.item_element_configure(@id, *args) @@ -2215,6 +2271,9 @@ class Tk::TreeCtrl::Style < TkObject def cget(opt) @tree.style_cget(@id, opt) end + def cget_strict(opt) + @tree.style_cget_strict(@id, opt) + end def configure(*args) @tree.style_configure(@id, *args) -- cgit v1.2.3