diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-10 20:59:10 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-10 20:59:10 +0000 |
commit | e6697a6405f1330ef071220396b8afef1cd1079a (patch) | |
tree | 3511a2ec3157a1b4d931153e84dbcae1c2fdd32a /ext/tk/lib/tkextlib/blt | |
parent | af0c875e26280869f216f69608919a8c721e4c68 (diff) |
* 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
Diffstat (limited to 'ext/tk/lib/tkextlib/blt')
-rw-r--r-- | ext/tk/lib/tkextlib/blt/component.rb | 101 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/blt/dragdrop.rb | 6 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/blt/htext.rb | 1 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/blt/table.rb | 17 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/blt/tabset.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/blt/ted.rb | 9 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/blt/treeview.rb | 31 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/blt/unix_dnd.rb | 16 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/blt/watch.rb | 19 |
9 files changed, 187 insertions, 17 deletions
diff --git a/ext/tk/lib/tkextlib/blt/component.rb b/ext/tk/lib/tkextlib/blt/component.rb index dd387634ee..b2005b2f2b 100644 --- a/ext/tk/lib/tkextlib/blt/component.rb +++ b/ext/tk/lib/tkextlib/blt/component.rb @@ -85,6 +85,9 @@ module Tk::BLT def axis_cget(id, option) ret = itemcget(['axis', tagid(id)], option) end + def axis_cget_strict(id, option) + ret = itemcget_strict(['axis', tagid(id)], option) + end def axis_configure(*args) slot = args.pop if slot.kind_of?(Hash) @@ -118,6 +121,9 @@ module Tk::BLT def crosshairs_cget(option) itemcget('crosshairs', option) end + def crosshairs_cget_strict(option) + itemcget_strict('crosshairs', option) + end def crosshairs_configure(slot, value=None) itemconfigure('crosshairs', slot, value) end @@ -131,6 +137,9 @@ module Tk::BLT def element_cget(id, option) itemcget(['element', tagid(id)], option) end + def element_cget_strict(id, option) + itemcget_strict(['element', tagid(id)], option) + end def element_configure(*args) slot = args.pop if slot.kind_of?(Hash) @@ -152,6 +161,9 @@ module Tk::BLT def bar_cget(id, option) itemcget(['bar', tagid(id)], option) end + def bar_cget_strict(id, option) + itemcget_strict(['bar', tagid(id)], option) + end def bar_configure(*args) slot = args.pop if slot.kind_of?(Hash) @@ -173,6 +185,9 @@ module Tk::BLT def line_cget(id, option) itemcget(['line', tagid(id)], option) end + def line_cget_strict(id, option) + itemcget_strict(['line', tagid(id)], option) + end def line_configure(*args) slot = args.pop if slot.kind_of?(Hash) @@ -194,6 +209,9 @@ module Tk::BLT def gridline_cget(option) itemcget('grid', option) end + def gridline_cget_strict(option) + itemcget_strict('grid', option) + end def gridline_configure(slot, value=None) itemconfigure('grid', slot, value) end @@ -207,6 +225,9 @@ module Tk::BLT def legend_cget(option) itemcget('legend', option) end + def legend_cget_strict(option) + itemcget_strict('legend', option) + end def legend_configure(slot, value=None) itemconfigure('legend', slot, value) end @@ -220,6 +241,9 @@ module Tk::BLT def pen_cget(id, option) itemcget(['pen', tagid(id)], option) end + def pen_cget_strict(id, option) + itemcget_strict(['pen', tagid(id)], option) + end def pen_configure(*args) slot = args.pop if slot.kind_of?(Hash) @@ -241,6 +265,9 @@ module Tk::BLT def postscript_cget(option) itemcget('postscript', option) end + def postscript_cget_strict(option) + itemcget_strict('postscript', option) + end def postscript_configure(slot, value=None) itemconfigure('postscript', slot, value) end @@ -254,6 +281,9 @@ module Tk::BLT def marker_cget(id, option) itemcget(['marker', tagid(id)], option) end + def marker_cget_strict(id, option) + itemcget_strict(['marker', tagid(id)], option) + end def marker_configure(*args) slot = args.pop if slot.kind_of?(Hash) @@ -273,11 +303,12 @@ module Tk::BLT end alias __itemcget itemcget + alias __itemcget_strict itemcget_strict alias __itemconfiginfo itemconfiginfo alias __current_itemconfiginfo current_itemconfiginfo private :__itemcget, :__itemconfiginfo, :__current_itemconfiginfo - def itemcget(tagOrId, option) + def itemcget_strict(tagOrId, option) ret = __itemcget(tagid(tagOrId), option) if option == 'bindtags' || option == :bindtags ret.collect{|tag| TkBindTag.id2obj(tag)} @@ -285,6 +316,27 @@ module Tk::BLT ret end end + def itemcget(tagOrId, option) + unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ + itemcget_strict(tagOrId, option) + else + begin + itemcget_strict(tagOrId, option) + rescue => e + begin + if current_itemconfiginfo(tagOrId).has_key?(option.to_s) + # error on known option + fail e + else + # unknown option + nil + end + rescue + fail e # tag error + end + end + end + end def itemconfiginfo(tagOrId, slot = nil) ret = __itemconfiginfo(tagid(tagOrId), slot) @@ -321,8 +373,8 @@ module Tk::BLT ret end - private :itemcget, :itemconfigure - private :itemconfiginfo, :current_itemconfiginfo + private :itemcget, :itemcget_strict + private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo ################# @@ -428,6 +480,9 @@ module Tk::BLT def cget(option) @chart.axis_cget(@id, option) end + def cget_strict(option) + @chart.axis_cget_strict(@id, option) + end def configure(key, value=None) @chart.axis_configure(@id, key, value) self @@ -530,6 +585,9 @@ module Tk::BLT def cget(option) @chart.crosshair_cget(option) end + def cget_strict(option) + @chart.crosshair_cget_strict(option) + end def configure(key, value=None) @chart.crosshair_configure(key, value) self @@ -675,6 +733,9 @@ module Tk::BLT # @chart.element_cget(@id, option) @chart.__send__(@typename + '_cget', @id, option) end + def cget_strict(option) + @chart.__send__(@typename + '_cget_strict', @id, option) + end def configure(key, value=None) # @chart.element_configure(@id, key, value) @chart.__send__(@typename + '_configure', @id, key, value) @@ -775,6 +836,9 @@ module Tk::BLT def cget(option) @chart.gridline_cget(option) end + def cget_strict(option) + @chart.gridline_cget_strict(option) + end def configure(key, value=None) @chart.gridline_configure(key, value) self @@ -846,6 +910,9 @@ module Tk::BLT def cget(option) @chart.legend_cget(option) end + def cget_strict(option) + @chart.legend_cget_strict(option) + end def configure(key, value=None) @chart.legend_configure(key, value) self @@ -972,6 +1039,9 @@ module Tk::BLT def cget(option) @chart.pen_cget(@id, option) end + def cget_strict(option) + @chart.pen_cget_strict(@id, option) + end def configure(key, value=None) @chart.pen_configure(@id, key, value) self @@ -1039,6 +1109,9 @@ module Tk::BLT def cget(option) @chart.postscript_cget(option) end + def cget_strict(option) + @chart.postscript_cget_strict(option) + end def configure(key, value=None) @chart.postscript_configure(key, value) self @@ -1117,6 +1190,13 @@ module Tk::BLT fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey) } + __item_optkey_aliases(nil).each{|alias_name, real_name| + alias_name = alias_name.to_s + if keys.has_key?(alias_name) + keys[real_name.to_s] = keys.delete(alias_name) + end + } + __item_methodcall_optkeys(nil).each{|key| key = key.to_s methodkeys[key] = keys.delete(key) if keys.key?(key) @@ -1192,6 +1272,9 @@ module Tk::BLT def cget(option) @chart.marker_cget(@id, option) end + def cget_strict(option) + @chart.marker_cget_strict(@id, option) + end def configure(key, value=None) @chart.marker_configure(@id, key, value) self @@ -1774,6 +1857,9 @@ module Tk::BLT def xaxis_cget(option) itemcget('xaxis', option) end + def xaxis_cget_strict(option) + itemcget_strict('xaxis', option) + end def xaxis_configure(slot, value=None) if slot.kind_of?(Hash) slot = _symbolkey2str(slot) @@ -1843,6 +1929,9 @@ module Tk::BLT def x2axis_cget(option) itemcget('x2axis', option) end + def x2axis_cget_strict(option) + itemcget_strict('x2axis', option) + end def x2axis_configure(slot, value=None) if slot.kind_of?(Hash) slot = _symbolkey2str(slot) @@ -1912,6 +2001,9 @@ module Tk::BLT def yaxis_cget(option) itemcget('yaxis', option) end + def yaxis_cget_strict(option) + itemcget_strict('yaxis', option) + end def yaxis_configure(slot, value=None) if slot.kind_of?(Hash) slot = _symbolkey2str(slot) @@ -1981,6 +2073,9 @@ module Tk::BLT def y2axis_cget(option) itemcget('y2axis', option) end + def y2axis_cget_strict(option) + itemcget_strict('y2axis', option) + end def y2axis_configure(slot, value=None) if slot.kind_of?(Hash) slot = _symbolkey2str(slot) diff --git a/ext/tk/lib/tkextlib/blt/dragdrop.rb b/ext/tk/lib/tkextlib/blt/dragdrop.rb index 98b1a4832f..201548504a 100644 --- a/ext/tk/lib/tkextlib/blt/dragdrop.rb +++ b/ext/tk/lib/tkextlib/blt/dragdrop.rb @@ -81,6 +81,7 @@ module Tk::BLT nil ] +=begin # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) ) KEY_TBL.map!{|inf| if inf.kind_of?(Array) @@ -96,6 +97,7 @@ module Tk::BLT end inf } +=end _setup_subst_table(KEY_TBL, PROC_TBL) @@ -123,6 +125,7 @@ module Tk::BLT nil ] +=begin # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) ) KEY_TBL.map!{|inf| if inf.kind_of?(Array) @@ -138,6 +141,7 @@ module Tk::BLT end inf } +=end _setup_subst_table(KEY_TBL, PROC_TBL) @@ -177,6 +181,7 @@ module Tk::BLT nil ] +=begin # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) ) KEY_TBL.map!{|inf| if inf.kind_of?(Array) @@ -192,6 +197,7 @@ module Tk::BLT end inf } +=end _setup_subst_table(KEY_TBL, PROC_TBL) end diff --git a/ext/tk/lib/tkextlib/blt/htext.rb b/ext/tk/lib/tkextlib/blt/htext.rb index a0cf3dc036..0d9cb30185 100644 --- a/ext/tk/lib/tkextlib/blt/htext.rb +++ b/ext/tk/lib/tkextlib/blt/htext.rb @@ -22,6 +22,7 @@ module Tk::BLT WidgetClassNames[WidgetClassName] = self alias window_cget itemcget + alias window_cget_strict itemcget_strict alias window_configure itemconfigure alias window_configuinfo itemconfiginfo alias current_window_configuinfo current_itemconfiginfo diff --git a/ext/tk/lib/tkextlib/blt/table.rb b/ext/tk/lib/tkextlib/blt/table.rb index 0be9d8d42a..dfa10269ed 100644 --- a/ext/tk/lib/tkextlib/blt/table.rb +++ b/ext/tk/lib/tkextlib/blt/table.rb @@ -29,6 +29,9 @@ module Tk::BLT def blt_table_cget(*args) Tk::BLT::Table.cget(self, *args) end + def blt_table_cget_strict(*args) + Tk::BLT::Table.cget_strict(self, *args) + end def blt_table_configure(*args) Tk::BLT::Table.configure(self, *args) @@ -92,6 +95,9 @@ module Tk::BLT def blt_table_itemcget(*args) Tk::BLT::Table.itemcget(self, *args) end + def blt_table_itemcget_strict(*args) + Tk::BLT::Table.itemcget_strict(self, *args) + end def blt_table_itemconfigure(*args) Tk::BLT::Table.itemconfigure(self, *args) @@ -136,12 +142,13 @@ class << Tk::BLT::Table private :__item_pathname alias __itemcget itemcget + alias __itemcget_strict itemcget_strict alias __itemconfigure itemconfigure alias __itemconfiginfo itemconfiginfo alias __current_itemconfiginfo current_itemconfiginfo - private :__itemcget, :__itemconfigure - private :__itemconfiginfo, :__current_itemconfiginfo + private :__itemcget, :__itemcget_strict + private :__itemconfigure, :__itemconfiginfo, :__current_itemconfiginfo def __boolval_optkeys super() << 'propagate' @@ -176,6 +183,9 @@ class << Tk::BLT::Table def cget(container, option) __itemcget([container], option) end + def cget_strict(container, option) + __itemcget_strict([container], option) + end def configure(container, *args) __itemconfigure([container], *args) @@ -192,6 +202,9 @@ class << Tk::BLT::Table def itemcget(container, item, option) __itemcget([container, tagid(item)], option) end + def itemcget_strict(container, item, option) + __itemcget_strict([container, tagid(item)], option) + end def itemconfigure(container, *args) if args[-1].kind_of?(Hash) diff --git a/ext/tk/lib/tkextlib/blt/tabset.rb b/ext/tk/lib/tkextlib/blt/tabset.rb index 1a0f312c4c..ca81ad8f95 100644 --- a/ext/tk/lib/tkextlib/blt/tabset.rb +++ b/ext/tk/lib/tkextlib/blt/tabset.rb @@ -128,6 +128,9 @@ module Tk::BLT def cget(*args) @t.tab_cget(@id, *args) end + def cget_strict(*args) + @t.tab_cget_strict(@id, *args) + end def configure(*args) @t.tab_configure(@id, *args) end @@ -240,6 +243,7 @@ module Tk::BLT private :__item_pathname alias tab_cget itemcget + alias tab_cget_strict itemcget_strict alias tab_configure itemconfigure alias tab_configinfo itemconfiginfo alias current_tab_configinfo current_itemconfiginfo diff --git a/ext/tk/lib/tkextlib/blt/ted.rb b/ext/tk/lib/tkextlib/blt/ted.rb index 39495842b4..670265fc78 100644 --- a/ext/tk/lib/tkextlib/blt/ted.rb +++ b/ext/tk/lib/tkextlib/blt/ted.rb @@ -30,11 +30,14 @@ module Tk::BLT end private :__item_config_cmd - private :itemcget, :itemconfigure - private :itemconfiginfo, :current_itemconfiginfo + private :itemcget, :itemcget_strict + private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo def cget(master, option) - itemconfigure(master, slot, value) + itemcget(master, option) + end + def cget_strict(master, option) + itemcget_strict(master, option) end def configure(master, slot, value=None) itemconfigure(master, slot, value) diff --git a/ext/tk/lib/tkextlib/blt/treeview.rb b/ext/tk/lib/tkextlib/blt/treeview.rb index fc890614be..c5a5697186 100644 --- a/ext/tk/lib/tkextlib/blt/treeview.rb +++ b/ext/tk/lib/tkextlib/blt/treeview.rb @@ -98,6 +98,9 @@ module Tk::BLT::Treeview::ConfigMethod def column_cget(name, option) itemcget(['column', name], option) end + def column_cget_strict(name, option) + itemcget_strict(['column', name], option) + end def column_configure(name, slot, value=None) itemconfigure(['column', name], slot, value) end @@ -111,6 +114,9 @@ module Tk::BLT::Treeview::ConfigMethod def button_cget(option) itemcget('button', option) end + def button_cget_strict(option) + itemcget_strict('button', option) + end def button_configure(slot, value=None) itemconfigure('button', slot, value) end @@ -129,6 +135,14 @@ module Tk::BLT::Treeview::ConfigMethod ret end end + def entry_cget_strict(option) + ret = itemcget_strict('entry', option) + if option == 'bindtags' || option == :bindtags + ret.collect{|tag| TkBindTag.id2obj(tag)} + else + ret + end + end def entry_configure(slot, value=None) itemconfigure('entry', slot, value) end @@ -170,6 +184,9 @@ module Tk::BLT::Treeview::ConfigMethod def sort_cget(option) itemcget('sort', option) end + def sort_cget_strict(option) + itemcget_strict('sort', option) + end def sort_configure(slot, value=None) itemconfigure('sort', slot, value) end @@ -183,6 +200,9 @@ module Tk::BLT::Treeview::ConfigMethod def text_cget(option) itemcget('text', option) end + def text_cget_strict(option) + itemcget_strict('text', option) + end def text_configure(slot, value=None) itemconfigure('text', slot, value) end @@ -193,8 +213,8 @@ module Tk::BLT::Treeview::ConfigMethod current_itemconfiginfo('text', slot) end - private :itemcget, :itemconfigure - private :itemconfiginfo, :current_itemconfiginfo + private :itemcget, :itemcget_strict + private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo end class Tk::BLT::Treeview @@ -239,6 +259,7 @@ class Tk::BLT::Treeview nil ] +=begin # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) ) KEY_TBL.map!{|inf| if inf.kind_of?(Array) @@ -254,6 +275,7 @@ class Tk::BLT::Treeview end inf } +=end _setup_subst_table(KEY_TBL, PROC_TBL); @@ -492,6 +514,7 @@ class Tk::BLT::Treeview nil ] +=begin # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) ) KEY_TBL.map!{|inf| if inf.kind_of?(Array) @@ -507,6 +530,7 @@ class Tk::BLT::Treeview end inf } +=end _setup_subst_table(KEY_TBL, PROC_TBL); @@ -523,7 +547,8 @@ class Tk::BLT::Treeview def _find_exec_flag_value(val) if val.kind_of?(Array) cmd, *args = val - FindExecFlagValue.new(cmd, args.join(' ')) + #FindExecFlagValue.new(cmd, args.join(' ')) + FindExecFlagValue.new(cmd, *args) elsif TkComm._callback_entry?(val) FindExecFlagValue.new(val) else diff --git a/ext/tk/lib/tkextlib/blt/unix_dnd.rb b/ext/tk/lib/tkextlib/blt/unix_dnd.rb index 3130c1e56f..445002d7a5 100644 --- a/ext/tk/lib/tkextlib/blt/unix_dnd.rb +++ b/ext/tk/lib/tkextlib/blt/unix_dnd.rb @@ -30,11 +30,14 @@ module Tk::BLT end private :__item_config_cmd - private :itemcget, :itemconfigure - private :itemconfiginfo, :current_itemconfiginfo + private :itemcget, :itemcget_strict + private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo def cget(win, option) - itemconfigure(['cget', win], slot, value) + itemcget(['cget', win], option) + end + def cget_strict(win, option) + itemcget_strict(['cget', win], option) end def configure(win, slot, value=None) itemconfigure(['configure', win], slot, value) @@ -46,8 +49,11 @@ module Tk::BLT current_itemconfiginfo(['configure', win], slot) end - def tokwn_cget(win, option) - itemconfigure(['token', 'cget', win], slot, value) + def token_cget(win, option) + itemcget(['token', 'cget', win], option) + end + def token_cget_strict(win, option) + itemcget_strict(['token', 'cget', win], option) end def token_configure(win, slot, value=None) itemconfigure(['token', 'configure', win], slot, value) diff --git a/ext/tk/lib/tkextlib/blt/watch.rb b/ext/tk/lib/tkextlib/blt/watch.rb index 2daf417e0b..219ff78e97 100644 --- a/ext/tk/lib/tkextlib/blt/watch.rb +++ b/ext/tk/lib/tkextlib/blt/watch.rb @@ -146,7 +146,7 @@ module Tk::BLT end end end - def cget(key) + def cget_strict(key) key = key.to_s begin info.assoc(key)[1] @@ -154,5 +154,22 @@ module Tk::BLT fail ArgumentError, "unknown option '#{key}'" end end + def cget(key) + unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ + cget_strict(key) + else + begin + cget_strict(key) + rescue => e + if current_configinfo.has_key?(key.to_s) + # error on known option + fail e + else + # unknown option + nil + end + end + end + end end end |