mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
af0c875e26
commit
e6697a6405
220 changed files with 7112 additions and 1277 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue