2005-03-05 07:35:41 +00:00
|
|
|
#
|
|
|
|
# treeview widget
|
|
|
|
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
|
|
|
|
#
|
|
|
|
require 'tk'
|
|
|
|
require 'tkextlib/tile.rb'
|
|
|
|
|
|
|
|
module Tk
|
|
|
|
module Tile
|
|
|
|
class Treeview < TkWindow
|
|
|
|
end
|
2006-11-06 06:56:37 +00:00
|
|
|
end
|
|
|
|
end
|
2005-03-05 07:35:41 +00:00
|
|
|
|
* ext/tk/lib/tk.rb, ext/tk/lib/*: make default widget set
switchable between Tk (standard Tcl/Tk widget set) and
Ttk (Tile). Initial default widget set is Tk. Now, toplevel
widget classes are removed and defined as aliases.
For example, "TkButton" is an alias of the "Tk::Button" class.
Those aliases are replaced when switching default widget set.
"Tk.default_widget_set=" is the method for switching default
widget set. "Tk.default_widget_set = :Ttk" defines Ttk (Tile)
widget set as default. It means that "TkButton" denotes
"Tk::Tile::Button" class. And then, "TkButton.new" creates
a Tk::Tile::Button widget. Of course, you can back to use
standard Tk widgets as the default widget set by calling
"Tk.default_widget_set = :Tk", whenever you want. Based on
thie feature, you can use Ttk widget styling engine on your
old Ruby/Tk application without modifying its source, if you
don'tuse widget options unsupported on Ttk widgets (At first,
call "Tk.default_widget_set = :Ttk", and next load and run
your application).
This is one step for supporting Tcl/Tk8.5 features.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-27 18:44:31 +00:00
|
|
|
Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Treeview, :TkTreeview)
|
|
|
|
|
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
module Tk::Tile::TreeviewConfig
|
|
|
|
include TkItemConfigMethod
|
2005-03-05 07:35:41 +00:00
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
def __item_configinfo_struct(id)
|
|
|
|
# maybe need to override
|
|
|
|
{:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil,
|
|
|
|
:default_value=>nil, :current_value=>1}
|
|
|
|
end
|
|
|
|
private :__item_configinfo_struct
|
2005-03-05 07:35:41 +00:00
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
def __itemconfiginfo_core(tagOrId, slot = nil)
|
|
|
|
if TkComm::GET_CONFIGINFO_AS_ARRAY
|
|
|
|
if (slot && slot.to_s =~ /^(|latin|ascii|kanji)(#{__item_font_optkeys(tagid(tagOrId)).join('|')})$/)
|
|
|
|
fontkey = $2
|
|
|
|
return [slot.to_s, tagfontobj(tagid(tagOrId), fontkey)]
|
|
|
|
else
|
|
|
|
if slot
|
|
|
|
slot = slot.to_s
|
* 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
2008-06-10 20:59:10 +00:00
|
|
|
|
|
|
|
alias_name, real_name = __item_optkey_aliases(tagid(tagOrId)).find{|k, v| k.to_s == slot}
|
|
|
|
if real_name
|
|
|
|
slot = real_name.to_s
|
|
|
|
end
|
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
case slot
|
|
|
|
when /^(#{__tile_specific_item_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
begin
|
|
|
|
# On tile-0.7.{2-8}, 'state' options has no '-' at its head.
|
|
|
|
val = tk_call(*(__item_confinfo_cmd(tagid(tagOrId)) << slot))
|
|
|
|
rescue
|
|
|
|
# Maybe, 'state' option has '-' in future.
|
|
|
|
val = tk_call(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
|
|
|
|
end
|
|
|
|
return [slot, val]
|
|
|
|
|
|
|
|
when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/
|
|
|
|
method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[slot]
|
|
|
|
optval = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
|
|
|
|
begin
|
|
|
|
val = method.call(tagOrId, optval)
|
|
|
|
rescue => e
|
|
|
|
warn("Warning:: #{e.message} (when #{method}lcall(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
|
|
|
|
val = optval
|
|
|
|
end
|
|
|
|
return [slot, val]
|
|
|
|
|
|
|
|
when /^(#{__item_methodcall_optkeys(tagid(tagOrId)).keys.join('|')})$/
|
|
|
|
method = _symbolkey2str(__item_methodcall_optkeys(tagid(tagOrId)))[slot]
|
|
|
|
return [slot, self.__send__(method, tagOrId)]
|
|
|
|
|
|
|
|
when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
begin
|
|
|
|
val = number(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
|
|
|
|
rescue
|
|
|
|
val = nil
|
|
|
|
end
|
|
|
|
return [slot, val]
|
|
|
|
|
|
|
|
when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
val = num_or_str(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
|
|
|
|
return [slot, val]
|
|
|
|
|
|
|
|
when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
begin
|
|
|
|
val = bool(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
|
|
|
|
rescue
|
|
|
|
val = nil
|
|
|
|
end
|
|
|
|
return [slot, val]
|
|
|
|
|
|
|
|
when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
val = simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
|
|
|
|
return [slot, val]
|
|
|
|
|
|
|
|
when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
|
|
|
|
if val =~ /^[0-9]/
|
|
|
|
return [slot, list(val)]
|
|
|
|
else
|
|
|
|
return [slot, val]
|
|
|
|
end
|
|
|
|
|
|
|
|
when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
|
|
|
|
return [slot, val]
|
|
|
|
|
|
|
|
when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
|
|
|
|
if val.empty?
|
|
|
|
return [slot, nil]
|
|
|
|
else
|
|
|
|
return [slot, TkVarAccess.new(val)]
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
|
|
|
|
if val.index('{')
|
|
|
|
return [slot, tk_split_list(val)]
|
|
|
|
else
|
|
|
|
return [slot, tk_tcl2ruby(val)]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
else # ! slot
|
|
|
|
ret = Hash[*(tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)))), false, false))].to_a.collect{|conf|
|
|
|
|
conf[0] = conf[0][1..-1] if conf[0][0] == ?-
|
|
|
|
case conf[0]
|
|
|
|
when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/
|
|
|
|
method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[conf[0]]
|
|
|
|
optval = conf[1]
|
|
|
|
begin
|
|
|
|
val = method.call(tagOrId, optval)
|
|
|
|
rescue => e
|
|
|
|
warn("Warning:: #{e.message} (when #{method}.call(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
|
|
|
|
val = optval
|
|
|
|
end
|
|
|
|
conf[1] = val
|
|
|
|
|
|
|
|
when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
# do nothing
|
|
|
|
|
|
|
|
when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
begin
|
|
|
|
conf[1] = number(conf[1])
|
|
|
|
rescue
|
|
|
|
conf[1] = nil
|
|
|
|
end
|
|
|
|
|
|
|
|
when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
conf[1] = num_or_str(conf[1])
|
|
|
|
|
|
|
|
when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
begin
|
|
|
|
conf[1] = bool(conf[1])
|
|
|
|
rescue
|
|
|
|
conf[1] = nil
|
|
|
|
end
|
|
|
|
|
|
|
|
when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
conf[1] = simplelist(conf[1])
|
|
|
|
|
|
|
|
when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
if conf[1] =~ /^[0-9]/
|
|
|
|
conf[1] = list(conf[1])
|
|
|
|
end
|
|
|
|
|
|
|
|
when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
if conf[1].empty?
|
|
|
|
conf[1] = nil
|
|
|
|
else
|
|
|
|
conf[1] = TkVarAccess.new(conf[1])
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
if conf[1].index('{')
|
|
|
|
conf[1] = tk_split_list(conf[1])
|
|
|
|
else
|
|
|
|
conf[1] = tk_tcl2ruby(conf[1])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
conf
|
|
|
|
}
|
|
|
|
|
|
|
|
__item_font_optkeys(tagid(tagOrId)).each{|optkey|
|
|
|
|
optkey = optkey.to_s
|
|
|
|
fontconf = ret.assoc(optkey)
|
|
|
|
if fontconf
|
|
|
|
ret.delete_if{|inf| inf[0] =~ /^(|latin|ascii|kanji)#{optkey}$/}
|
|
|
|
fontconf[1] = tagfontobj(tagid(tagOrId), optkey)
|
|
|
|
ret.push(fontconf)
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
|
|
|
__item_methodcall_optkeys(tagid(tagOrId)).each{|optkey, method|
|
|
|
|
ret << [optkey.to_s, self.__send__(method, tagOrId)]
|
|
|
|
}
|
|
|
|
|
|
|
|
ret
|
2005-08-02 21:05:17 +00:00
|
|
|
end
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
2006-11-06 06:56:37 +00:00
|
|
|
|
|
|
|
else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
|
|
|
|
if (slot && slot.to_s =~ /^(|latin|ascii|kanji)(#{__item_font_optkeys(tagid(tagOrId)).join('|')})$/)
|
|
|
|
fontkey = $2
|
|
|
|
return {slot.to_s => tagfontobj(tagid(tagOrId), fontkey)}
|
|
|
|
else
|
|
|
|
if slot
|
|
|
|
slot = slot.to_s
|
* 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
2008-06-10 20:59:10 +00:00
|
|
|
|
|
|
|
alias_name, real_name = __item_optkey_aliases(tagid(tagOrId)).find{|k, v| k.to_s == slot}
|
|
|
|
if real_name
|
|
|
|
slot = real_name.to_s
|
|
|
|
end
|
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
case slot
|
|
|
|
when /^(#{__tile_specific_item_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
begin
|
|
|
|
# On tile-0.7.{2-8}, 'state' option has no '-' at its head.
|
|
|
|
val = tk_call(*(__item_confinfo_cmd(tagid(tagOrId)) << slot))
|
|
|
|
rescue
|
|
|
|
# Maybe, 'state' option has '-' in future.
|
|
|
|
val = tk_call(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
|
|
|
|
end
|
|
|
|
return {slot => val}
|
|
|
|
|
|
|
|
when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/
|
|
|
|
method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[slot]
|
|
|
|
optval = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
|
|
|
|
begin
|
|
|
|
val = method.call(tagOrId, optval)
|
|
|
|
rescue => e
|
|
|
|
warn("Warning:: #{e.message} (when #{method}lcall(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
|
|
|
|
val = optval
|
|
|
|
end
|
|
|
|
return {slot => val}
|
|
|
|
|
|
|
|
when /^(#{__item_methodcall_optkeys(tagid(tagOrId)).keys.join('|')})$/
|
|
|
|
method = _symbolkey2str(__item_methodcall_optkeys(tagid(tagOrId)))[slot]
|
|
|
|
return {slot => self.__send__(method, tagOrId)}
|
|
|
|
|
|
|
|
when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
begin
|
|
|
|
val = number(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
|
|
|
|
rescue
|
|
|
|
val = nil
|
|
|
|
end
|
|
|
|
return {slot => val}
|
|
|
|
|
|
|
|
when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
val = num_or_str(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
|
|
|
|
return {slot => val}
|
|
|
|
|
|
|
|
when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
begin
|
|
|
|
val = bool(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
|
|
|
|
rescue
|
|
|
|
val = nil
|
|
|
|
end
|
|
|
|
return {slot => val}
|
|
|
|
|
|
|
|
when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
val = simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
|
|
|
|
return {slot => val}
|
|
|
|
|
|
|
|
when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
|
|
|
|
if val =~ /^[0-9]/
|
|
|
|
return {slot => list(val)}
|
|
|
|
else
|
|
|
|
return {slot => val}
|
|
|
|
end
|
|
|
|
|
|
|
|
when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
|
|
|
|
return {slot => val}
|
|
|
|
|
|
|
|
when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
|
|
|
|
if val.empty?
|
|
|
|
return {slot => nil}
|
|
|
|
else
|
|
|
|
return {slot => TkVarAccess.new(val)}
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
|
|
|
|
if val.index('{')
|
|
|
|
return {slot => tk_split_list(val)}
|
|
|
|
else
|
|
|
|
return {slot => tk_tcl2ruby(val)}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
else # ! slot
|
|
|
|
ret = {}
|
|
|
|
ret = Hash[*(tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)))), false, false))].to_a.collect{|conf|
|
|
|
|
conf[0] = conf[0][1..-1] if conf[0][0] == ?-
|
|
|
|
|
|
|
|
optkey = conf[0]
|
|
|
|
case optkey
|
|
|
|
when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/
|
|
|
|
method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[optkey]
|
|
|
|
optval = conf[1]
|
|
|
|
begin
|
|
|
|
val = method.call(tagOrId, optval)
|
|
|
|
rescue => e
|
|
|
|
warn("Warning:: #{e.message} (when #{method}.call(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
|
|
|
|
val = optval
|
|
|
|
end
|
|
|
|
conf[1] = val
|
|
|
|
|
|
|
|
when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
# do nothing
|
|
|
|
|
|
|
|
when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
begin
|
|
|
|
conf[1] = number(conf[1])
|
|
|
|
rescue
|
|
|
|
conf[1] = nil
|
|
|
|
end
|
|
|
|
|
|
|
|
when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
conf[1] = num_or_str(conf[1])
|
|
|
|
|
|
|
|
when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
begin
|
|
|
|
conf[1] = bool(conf[1])
|
|
|
|
rescue
|
|
|
|
conf[1] = nil
|
|
|
|
end
|
|
|
|
|
|
|
|
when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
conf[1] = simplelist(conf[1])
|
|
|
|
|
|
|
|
when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
if conf[1] =~ /^[0-9]/
|
|
|
|
conf[1] = list(conf[1])
|
|
|
|
end
|
|
|
|
|
|
|
|
when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/
|
|
|
|
if conf[1].empty?
|
|
|
|
conf[1] = nil
|
|
|
|
else
|
|
|
|
conf[1] = TkVarAccess.new(conf[1])
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
if conf[1].index('{')
|
|
|
|
return [slot, tk_split_list(conf[1])]
|
|
|
|
else
|
|
|
|
return [slot, tk_tcl2ruby(conf[1])]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
ret[conf[0]] = conf[1]
|
|
|
|
}
|
|
|
|
|
|
|
|
__item_font_optkeys(tagid(tagOrId)).each{|optkey|
|
|
|
|
optkey = optkey.to_s
|
|
|
|
fontconf = ret[optkey]
|
|
|
|
if fontconf.kind_of?(Array)
|
|
|
|
ret.delete(optkey)
|
|
|
|
ret.delete('latin' << optkey)
|
|
|
|
ret.delete('ascii' << optkey)
|
|
|
|
ret.delete('kanji' << optkey)
|
|
|
|
fontconf[1] = tagfontobj(tagid(tagOrId), optkey)
|
|
|
|
ret[optkey] = fontconf
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
|
|
|
__item_methodcall_optkeys(tagid(tagOrId)).each{|optkey, method|
|
|
|
|
ret[optkey.to_s] = self.__send__(method, tagOrId)
|
|
|
|
}
|
|
|
|
|
|
|
|
ret
|
2005-08-02 21:05:17 +00:00
|
|
|
end
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
2006-11-06 06:56:37 +00:00
|
|
|
end
|
|
|
|
end
|
2005-03-05 07:35:41 +00:00
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
###################
|
2005-03-05 07:35:41 +00:00
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
def __item_cget_cmd(id)
|
2008-06-19 07:08:06 +00:00
|
|
|
[self.path, *id]
|
2006-11-06 06:56:37 +00:00
|
|
|
end
|
|
|
|
private :__item_cget_cmd
|
2005-03-05 07:35:41 +00:00
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
def __item_config_cmd(id)
|
2008-06-19 07:08:06 +00:00
|
|
|
[self.path, *id]
|
2006-11-06 06:56:37 +00:00
|
|
|
end
|
|
|
|
private :__item_config_cmd
|
2005-03-05 07:35:41 +00:00
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
def __item_numstrval_optkeys(id)
|
|
|
|
case id[0]
|
|
|
|
when :item, 'item'
|
|
|
|
['width']
|
|
|
|
when :column, 'column'
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 05:25:12 +00:00
|
|
|
super(id[1]) + ['minwidth']
|
2006-11-06 06:56:37 +00:00
|
|
|
when :tag, 'tag'
|
|
|
|
super(id[1])
|
|
|
|
when :heading, 'heading'
|
|
|
|
super(id[1])
|
|
|
|
else
|
|
|
|
super(id[1])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
private :__item_numstrval_optkeys
|
|
|
|
|
|
|
|
def __item_strval_optkeys(id)
|
|
|
|
case id[0]
|
|
|
|
when :item, 'item'
|
|
|
|
super(id) + ['id']
|
|
|
|
when :column, 'column'
|
|
|
|
super(id[1])
|
|
|
|
when :tag, 'tag'
|
|
|
|
super(id[1])
|
|
|
|
when :heading, 'heading'
|
|
|
|
super(id[1])
|
|
|
|
else
|
|
|
|
super(id[1])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
private :__item_strval_optkeys
|
|
|
|
|
|
|
|
def __item_boolval_optkeys(id)
|
|
|
|
case id[0]
|
|
|
|
when :item, 'item'
|
|
|
|
['open']
|
|
|
|
when :column, 'column'
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 05:25:12 +00:00
|
|
|
super(id[1]) + ['stretch']
|
2006-11-06 06:56:37 +00:00
|
|
|
when :tag, 'tag'
|
|
|
|
super(id[1])
|
|
|
|
when :heading, 'heading'
|
|
|
|
super(id[1])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
private :__item_boolval_optkeys
|
|
|
|
|
|
|
|
def __item_listval_optkeys(id)
|
|
|
|
case id[0]
|
|
|
|
when :item, 'item'
|
|
|
|
['values']
|
|
|
|
when :column, 'column'
|
|
|
|
[]
|
|
|
|
when :heading, 'heading'
|
|
|
|
[]
|
|
|
|
else
|
|
|
|
[]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
private :__item_listval_optkeys
|
|
|
|
|
|
|
|
def __item_val2ruby_optkeys(id)
|
|
|
|
case id[0]
|
|
|
|
when :item, 'item'
|
|
|
|
{
|
|
|
|
'tags'=>proc{|arg_id, val|
|
|
|
|
simplelist(val).collect{|tag|
|
|
|
|
Tk::Tile::Treeview::Tag.id2obj(self, tag)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
when :column, 'column'
|
|
|
|
{}
|
|
|
|
when :heading, 'heading'
|
|
|
|
{}
|
|
|
|
else
|
|
|
|
{}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
private :__item_val2ruby_optkeys
|
|
|
|
|
|
|
|
def __tile_specific_item_optkeys(id)
|
|
|
|
case id[0]
|
|
|
|
when :item, 'item'
|
|
|
|
[]
|
|
|
|
when :column, 'column'
|
|
|
|
[]
|
|
|
|
when :heading, 'heading'
|
|
|
|
['state'] # On tile-0.7.{2-8}, 'state' options has no '-' at its head.
|
|
|
|
else
|
|
|
|
[]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
private :__item_val2ruby_optkeys
|
|
|
|
|
|
|
|
def itemconfiginfo(tagOrId, slot = nil)
|
|
|
|
__itemconfiginfo_core(tagOrId, slot)
|
|
|
|
end
|
|
|
|
|
|
|
|
def current_itemconfiginfo(tagOrId, slot = nil)
|
|
|
|
if TkComm::GET_CONFIGINFO_AS_ARRAY
|
|
|
|
if slot
|
|
|
|
org_slot = slot
|
|
|
|
begin
|
|
|
|
conf = __itemconfiginfo_core(tagOrId, slot)
|
|
|
|
if ( ! __item_configinfo_struct(tagid(tagOrId))[:alias] \
|
|
|
|
|| conf.size > __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 )
|
|
|
|
return {conf[0] => conf[-1]}
|
|
|
|
end
|
|
|
|
slot = conf[__item_configinfo_struct(tagid(tagOrId))[:alias]]
|
|
|
|
end while(org_slot != slot)
|
|
|
|
fail RuntimeError,
|
|
|
|
"there is a configure alias loop about '#{org_slot}'"
|
|
|
|
else
|
|
|
|
ret = {}
|
|
|
|
__itemconfiginfo_core(tagOrId).each{|conf|
|
|
|
|
if ( ! __item_configinfo_struct(tagid(tagOrId))[:alias] \
|
|
|
|
|| conf.size > __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 )
|
|
|
|
ret[conf[0]] = conf[-1]
|
|
|
|
end
|
|
|
|
}
|
|
|
|
ret
|
2005-08-02 21:05:17 +00:00
|
|
|
end
|
2006-11-06 06:56:37 +00:00
|
|
|
else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
|
|
|
|
ret = {}
|
2006-11-07 09:11:38 +00:00
|
|
|
__itemconfiginfo_core(tagOrId, slot).each{|key, conf|
|
2006-11-06 06:56:37 +00:00
|
|
|
ret[key] = conf[-1] if conf.kind_of?(Array)
|
|
|
|
}
|
|
|
|
ret
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
alias __itemcget itemcget
|
* 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
2008-06-10 20:59:10 +00:00
|
|
|
alias __itemcget_strict itemcget_strict
|
2006-11-06 06:56:37 +00:00
|
|
|
alias __itemconfigure itemconfigure
|
|
|
|
alias __itemconfiginfo itemconfiginfo
|
|
|
|
alias __current_itemconfiginfo current_itemconfiginfo
|
|
|
|
|
* 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
2008-06-10 20:59:10 +00:00
|
|
|
private :__itemcget, :__itemcget_strict
|
|
|
|
private :__itemconfigure, :__itemconfiginfo, :__current_itemconfiginfo
|
2006-11-06 06:56:37 +00:00
|
|
|
|
|
|
|
# Treeview Item
|
|
|
|
def itemcget(tagOrId, option)
|
|
|
|
__itemcget([:item, tagOrId], option)
|
|
|
|
end
|
* 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
2008-06-10 20:59:10 +00:00
|
|
|
def itemcget_strict(tagOrId, option)
|
|
|
|
__itemcget_strict([:item, tagOrId], option)
|
|
|
|
end
|
2006-11-06 06:56:37 +00:00
|
|
|
def itemconfigure(tagOrId, slot, value=None)
|
|
|
|
__itemconfigure([:item, tagOrId], slot, value)
|
|
|
|
end
|
|
|
|
def itemconfiginfo(tagOrId, slot=nil)
|
|
|
|
__itemconfiginfo([:item, tagOrId], slot)
|
|
|
|
end
|
|
|
|
def current_itemconfiginfo(tagOrId, slot=nil)
|
|
|
|
__current_itemconfiginfo([:item, tagOrId], slot)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Treeview Column
|
|
|
|
def columncget(tagOrId, option)
|
|
|
|
__itemcget([:column, tagOrId], option)
|
|
|
|
end
|
* 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
2008-06-10 20:59:10 +00:00
|
|
|
def columncget_strict(tagOrId, option)
|
|
|
|
__itemcget_strict([:column, tagOrId], option)
|
|
|
|
end
|
2006-11-06 06:56:37 +00:00
|
|
|
def columnconfigure(tagOrId, slot, value=None)
|
|
|
|
__itemconfigure([:column, tagOrId], slot, value)
|
|
|
|
end
|
|
|
|
def columnconfiginfo(tagOrId, slot=nil)
|
|
|
|
__itemconfiginfo([:column, tagOrId], slot)
|
|
|
|
end
|
|
|
|
def current_columnconfiginfo(tagOrId, slot=nil)
|
|
|
|
__current_itemconfiginfo([:column, tagOrId], slot)
|
|
|
|
end
|
|
|
|
alias column_cget columncget
|
* 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
2008-06-10 20:59:10 +00:00
|
|
|
alias column_cget_strict columncget_strict
|
2006-11-06 06:56:37 +00:00
|
|
|
alias column_configure columnconfigure
|
|
|
|
alias column_configinfo columnconfiginfo
|
|
|
|
alias current_column_configinfo current_columnconfiginfo
|
|
|
|
|
|
|
|
# Treeview Heading
|
* 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
2008-06-10 20:59:10 +00:00
|
|
|
def headingcget_strict(tagOrId, option)
|
2006-11-06 06:56:37 +00:00
|
|
|
if __tile_specific_item_optkeys([:heading, tagOrId]).index(option.to_s)
|
|
|
|
begin
|
|
|
|
# On tile-0.7.{2-8}, 'state' options has no '-' at its head.
|
|
|
|
tk_call(*(__item_cget_cmd([:heading, tagOrId]) << option.to_s))
|
|
|
|
rescue
|
|
|
|
# Maybe, 'state' option has '-' in future.
|
|
|
|
tk_call(*(__item_cget_cmd([:heading, tagOrId]) << "-#{option}"))
|
2005-08-02 21:05:17 +00:00
|
|
|
end
|
2006-11-06 06:56:37 +00:00
|
|
|
else
|
* 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
2008-06-10 20:59:10 +00:00
|
|
|
__itemcget_strict([:heading, tagOrId], option)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
def headingcget(tagOrId, option)
|
|
|
|
unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
|
|
|
|
headingcget_strict(tagOrId, option)
|
|
|
|
else
|
|
|
|
begin
|
|
|
|
headingcget_strict(tagOrId, option)
|
|
|
|
rescue => e
|
|
|
|
begin
|
|
|
|
if current_headingconfiginfo(tagOrId).has_key?(option.to_s)
|
|
|
|
# not tag error & option is known -> error on known option
|
|
|
|
fail e
|
|
|
|
else
|
|
|
|
# not tag error & option is unknown
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
rescue
|
|
|
|
fail e # tag error
|
|
|
|
end
|
|
|
|
end
|
2006-11-06 06:56:37 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
def headingconfigure(tagOrId, slot, value=None)
|
|
|
|
if slot.kind_of?(Hash)
|
|
|
|
slot = _symbolkey2str(slot)
|
|
|
|
sp_kv = []
|
|
|
|
__tile_specific_item_optkeys([:heading, tagOrId]).each{|k|
|
|
|
|
sp_kv << k << _get_eval_string(slot.delete(k)) if slot.has_key?(k)
|
|
|
|
}
|
|
|
|
tk_call(*(__item_config_cmd([:heading, tagOrId]).concat(sp_kv)))
|
|
|
|
tk_call(*(__item_config_cmd([:heading, tagOrId]).concat(hash_kv(slot))))
|
|
|
|
elsif __tile_specific_item_optkeys([:heading, tagOrId]).index(slot.to_s)
|
|
|
|
begin
|
|
|
|
# On tile-0.7.{2-8}, 'state' options has no '-' at its head.
|
|
|
|
tk_call(*(__item_cget_cmd([:heading, tagOrId]) << slot.to_s << value))
|
|
|
|
rescue
|
|
|
|
# Maybe, 'state' option has '-' in future.
|
|
|
|
tk_call(*(__item_cget_cmd([:heading, tagOrId]) << "-#{slot}" << value))
|
2005-08-02 21:05:17 +00:00
|
|
|
end
|
2006-11-06 06:56:37 +00:00
|
|
|
else
|
|
|
|
__itemconfigure([:heading, tagOrId], slot, value)
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
2006-11-06 06:56:37 +00:00
|
|
|
self
|
|
|
|
end
|
|
|
|
def headingconfiginfo(tagOrId, slot=nil)
|
|
|
|
__itemconfiginfo([:heading, tagOrId], slot)
|
|
|
|
end
|
|
|
|
def current_headingconfiginfo(tagOrId, slot=nil)
|
|
|
|
__current_itemconfiginfo([:heading, tagOrId], slot)
|
|
|
|
end
|
|
|
|
alias heading_cget headingcget
|
* 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
2008-06-10 20:59:10 +00:00
|
|
|
alias heading_cget_strict headingcget_strict
|
2006-11-06 06:56:37 +00:00
|
|
|
alias heading_configure headingconfigure
|
|
|
|
alias heading_configinfo headingconfiginfo
|
|
|
|
alias current_heading_configinfo current_headingconfiginfo
|
|
|
|
|
|
|
|
# Treeview Tag
|
|
|
|
def tagcget(tagOrId, option)
|
2008-06-19 07:08:06 +00:00
|
|
|
__itemcget([:tag, :configure, tagOrId], option)
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
* 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
2008-06-10 20:59:10 +00:00
|
|
|
def tagcget_strict(tagOrId, option)
|
2008-06-19 07:08:06 +00:00
|
|
|
__itemcget_strict([:tag, :configure, tagOrId], option)
|
* 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
2008-06-10 20:59:10 +00:00
|
|
|
end
|
2006-11-06 06:56:37 +00:00
|
|
|
def tagconfigure(tagOrId, slot, value=None)
|
2008-06-19 07:08:06 +00:00
|
|
|
__itemconfigure([:tag, :configure, tagOrId], slot, value)
|
2006-11-06 06:56:37 +00:00
|
|
|
end
|
|
|
|
def tagconfiginfo(tagOrId, slot=nil)
|
2008-06-19 07:08:06 +00:00
|
|
|
__itemconfiginfo([:tag, :configure, tagOrId], slot)
|
2006-11-06 06:56:37 +00:00
|
|
|
end
|
|
|
|
def current_tagconfiginfo(tagOrId, slot=nil)
|
2008-06-19 07:08:06 +00:00
|
|
|
__current_itemconfiginfo([:tag, :configure, tagOrId], slot)
|
2006-11-06 06:56:37 +00:00
|
|
|
end
|
|
|
|
alias tag_cget tagcget
|
* 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
2008-06-10 20:59:10 +00:00
|
|
|
alias tag_cget_strict tagcget_strict
|
2006-11-06 06:56:37 +00:00
|
|
|
alias tag_configure tagconfigure
|
|
|
|
alias tag_configinfo tagconfiginfo
|
|
|
|
alias current_tag_configinfo current_tagconfiginfo
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
########################
|
|
|
|
|
|
|
|
class Tk::Tile::Treeview::Item < TkObject
|
|
|
|
ItemID_TBL = TkCore::INTERP.create_table
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 05:25:12 +00:00
|
|
|
|
|
|
|
TkCore::INTERP.init_ip_env{
|
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
|
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL.clear
|
|
|
|
}
|
|
|
|
}
|
2006-11-06 06:56:37 +00:00
|
|
|
|
|
|
|
def self.id2obj(tree, id)
|
|
|
|
tpath = tree.path
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 05:25:12 +00:00
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
|
|
|
|
if Tk::Tile::Treeview::Item::ItemID_TBL[tpath]
|
|
|
|
(Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id])? \
|
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id]: id
|
|
|
|
else
|
|
|
|
id
|
|
|
|
end
|
|
|
|
}
|
2006-11-06 06:56:37 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.assign(tree, id)
|
|
|
|
tpath = tree.path
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 05:25:12 +00:00
|
|
|
obj = nil
|
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
|
|
|
|
if Tk::Tile::Treeview::Item::ItemID_TBL[tpath] &&
|
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id]
|
|
|
|
return Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id]
|
|
|
|
end
|
2006-11-06 06:56:37 +00:00
|
|
|
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 05:25:12 +00:00
|
|
|
obj = self.allocate
|
|
|
|
obj.instance_eval{
|
|
|
|
@parent = @t = tree
|
|
|
|
@tpath = tpath
|
|
|
|
@path = @id = id
|
|
|
|
}
|
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL[tpath] ||= {}
|
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id] = obj
|
2006-11-06 06:56:37 +00:00
|
|
|
}
|
|
|
|
obj
|
|
|
|
end
|
|
|
|
|
|
|
|
def _insert_item(tree, parent_item, idx, keys={})
|
|
|
|
keys = _symbolkey2str(keys)
|
|
|
|
id = keys.delete('id')
|
|
|
|
if id
|
|
|
|
num_or_str(tk_call(tree, 'insert',
|
|
|
|
parent_item, idx, '-id', id, *hash_kv(keys)))
|
|
|
|
else
|
|
|
|
num_or_str(tk_call(tree, 'insert', parent_item, idx, *hash_kv(keys)))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
private :_insert_item
|
|
|
|
|
|
|
|
def initialize(tree, parent_item = '', idx = 'end', keys = {})
|
|
|
|
if parent_item.kind_of?(Hash)
|
|
|
|
keys = parent_item
|
|
|
|
idx = 'end'
|
|
|
|
parent_item = ''
|
|
|
|
elsif idx.kind_of?(Hash)
|
|
|
|
keys = idx
|
|
|
|
idx = 'end'
|
|
|
|
end
|
|
|
|
|
|
|
|
@parent = @t = tree
|
|
|
|
@tpath = tree.path
|
|
|
|
@path = @id = _insert_item(@t, parent_item, idx, keys)
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 05:25:12 +00:00
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
|
|
|
|
ItemID_TBL[@tpath] = {} unless ItemID_TBL[@tpath]
|
|
|
|
ItemID_TBL[@tpath][@id] = self
|
|
|
|
}
|
2006-11-06 06:56:37 +00:00
|
|
|
end
|
|
|
|
def id
|
|
|
|
@id
|
|
|
|
end
|
|
|
|
|
|
|
|
def cget(option)
|
|
|
|
@t.itemcget(@id, option)
|
|
|
|
end
|
* 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
2008-06-10 20:59:10 +00:00
|
|
|
def cget_strict(option)
|
|
|
|
@t.itemcget_strict(@id, option)
|
|
|
|
end
|
2006-11-06 06:56:37 +00:00
|
|
|
|
|
|
|
def configure(key, value=None)
|
|
|
|
@t.itemconfigure(@id, key, value)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def configinfo(key=nil)
|
|
|
|
@t.itemconfiginfo(@id, key)
|
|
|
|
end
|
|
|
|
|
|
|
|
def current_configinfo(key=nil)
|
|
|
|
@t.current_itemconfiginfo(@id, key)
|
|
|
|
end
|
|
|
|
|
|
|
|
def open?
|
|
|
|
cget('open')
|
|
|
|
end
|
|
|
|
def open
|
|
|
|
configure('open', true)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
def close
|
|
|
|
configure('open', false)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def bbox(column=None)
|
|
|
|
@t.bbox(@id, column)
|
|
|
|
end
|
|
|
|
|
|
|
|
def children
|
|
|
|
@t.children(@id)
|
|
|
|
end
|
|
|
|
def set_children(*items)
|
|
|
|
@t.set_children(@id, *items)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def delete
|
|
|
|
@t.delete(@id)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def detach
|
|
|
|
@t.detach(@id)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def exist?
|
|
|
|
@t.exist?(@id)
|
|
|
|
end
|
|
|
|
|
|
|
|
def focus
|
|
|
|
@t.focus_item(@id)
|
|
|
|
end
|
|
|
|
|
|
|
|
def index
|
|
|
|
@t.index(@id)
|
|
|
|
end
|
|
|
|
|
|
|
|
def insert(idx='end', keys={})
|
|
|
|
@t.insert(@id, idx, keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def move(parent, idx)
|
|
|
|
@t.move(@id, parent, idx)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def next_item
|
|
|
|
@t.next_item(@id)
|
|
|
|
end
|
|
|
|
|
|
|
|
def parent_item
|
|
|
|
@t.parent_item(@id)
|
|
|
|
end
|
|
|
|
|
|
|
|
def prev_item
|
|
|
|
@t.prev_item(@id)
|
|
|
|
end
|
|
|
|
|
|
|
|
def see
|
|
|
|
@t.see(@id)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def selection_add
|
|
|
|
@t.selection_add(@id)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def selection_remove
|
|
|
|
@t.selection_remove(@id)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def selection_set
|
|
|
|
@t.selection_set(@id)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def selection_toggle
|
|
|
|
@t.selection_toggle(@id)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_directory
|
|
|
|
@t.get_directory(@id)
|
|
|
|
end
|
|
|
|
alias get_dictionary get_directory
|
|
|
|
|
|
|
|
def get(col)
|
|
|
|
@t.get(@id, col)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set(col, value)
|
|
|
|
@t.set(@id, col, value)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
########################
|
|
|
|
|
|
|
|
class Tk::Tile::Treeview::Root < Tk::Tile::Treeview::Item
|
|
|
|
def self.new(tree, keys = {})
|
|
|
|
tpath = tree.path
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 05:25:12 +00:00
|
|
|
obj = nil
|
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
|
|
|
|
if Tk::Tile::Treeview::Item::ItemID_TBL[tpath] &&
|
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL[tpath]['']
|
|
|
|
obj = Tk::Tile::Treeview::Item::ItemID_TBL[tpath]['']
|
|
|
|
else
|
|
|
|
#super(tree, keys)
|
|
|
|
(obj = self.allocate).instance_eval{
|
|
|
|
@parent = @t = tree
|
|
|
|
@tpath = tree.path
|
|
|
|
@path = @id = ''
|
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL[@tpath] ||= {}
|
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL[@tpath][@id] = self
|
|
|
|
}
|
|
|
|
end
|
|
|
|
}
|
|
|
|
obj.configure(keys) if keys && ! keys.empty?
|
|
|
|
obj
|
2006-11-06 06:56:37 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def initialize(tree, keys = {})
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 05:25:12 +00:00
|
|
|
# dummy:: not called by 'new' method
|
2006-11-06 06:56:37 +00:00
|
|
|
@parent = @t = tree
|
|
|
|
@tpath = tree.path
|
|
|
|
@path = @id = ''
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 05:25:12 +00:00
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
|
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL[@tpath] ||= {}
|
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL[@tpath][@id] = self
|
|
|
|
}
|
2006-11-06 06:56:37 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
########################
|
|
|
|
|
|
|
|
class Tk::Tile::Treeview::Tag < TkObject
|
|
|
|
include TkTreatTagFont
|
|
|
|
|
|
|
|
TagID_TBL = TkCore::INTERP.create_table
|
|
|
|
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 05:25:12 +00:00
|
|
|
(Tag_ID = ['tile_treeview_tag'.freeze, '00000'.taint]).instance_eval{
|
|
|
|
@mutex = Mutex.new
|
|
|
|
def mutex; @mutex; end
|
|
|
|
freeze
|
|
|
|
}
|
|
|
|
|
|
|
|
TkCore::INTERP.init_ip_env{
|
|
|
|
Tk::Tile::Treeview::Tag::TagID_TBL.mutex.synchronize{
|
|
|
|
Tk::Tile::Treeview::Tag::TagID_TBL.clear
|
|
|
|
}
|
|
|
|
}
|
2006-11-06 06:56:37 +00:00
|
|
|
|
|
|
|
def self.id2obj(tree, id)
|
|
|
|
tpath = tree.path
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 05:25:12 +00:00
|
|
|
Tk::Tile::Treeview::Tag::TagID_TBL.mutex.synchronize{
|
|
|
|
if Tk::Tile::Treeview::Tag::TagID_TBL[tpath]
|
|
|
|
(Tk::Tile::Treeview::Tag::TagID_TBL[tpath][id])? \
|
|
|
|
Tk::Tile::Treeview::Tag::TagID_TBL[tpath][id]: id
|
|
|
|
else
|
|
|
|
id
|
|
|
|
end
|
|
|
|
}
|
2006-11-06 06:56:37 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def initialize(tree, keys=nil)
|
|
|
|
@parent = @t = tree
|
|
|
|
@tpath = tree.path
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 05:25:12 +00:00
|
|
|
Tag_ID.mutex.synchronize{
|
|
|
|
@path = @id = Tag_ID.join(TkCore::INTERP._ip_id_)
|
|
|
|
Tag_ID[1].succ!
|
|
|
|
}
|
|
|
|
TagID_TBL.mutex.synchronize{
|
|
|
|
TagID_TBL[@tpath] = {} unless TagID_TBL[@tpath]
|
|
|
|
TagID_TBL[@tpath][@id] = self
|
|
|
|
}
|
2006-11-06 06:56:37 +00:00
|
|
|
if keys && keys != None
|
2008-06-19 07:08:06 +00:00
|
|
|
tk_call_without_enc(@tpath, 'tag', 'configure', @id, *hash_kv(keys,true))
|
2006-11-06 06:56:37 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
def id
|
|
|
|
@id
|
|
|
|
end
|
|
|
|
|
|
|
|
def bind(seq, *args)
|
|
|
|
if TkComm._callback_entry?(args[0]) || !block_given?
|
|
|
|
cmd = args.shift
|
|
|
|
else
|
|
|
|
cmd = Proc.new
|
|
|
|
end
|
|
|
|
@t.tag_bind(@id, seq, cmd, *args)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def bind_append(seq, *args)
|
|
|
|
if TkComm._callback_entry?(args[0]) || !block_given?
|
|
|
|
cmd = args.shift
|
|
|
|
else
|
|
|
|
cmd = Proc.new
|
|
|
|
end
|
|
|
|
@t.tag_bind_append(@id, seq, cmd, *args)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def bind_remove(seq)
|
|
|
|
@t.tag_bind_remove(@id, seq)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def bindinfo(seq=nil)
|
|
|
|
@t.tag_bindinfo(@id, seq)
|
|
|
|
end
|
|
|
|
|
|
|
|
def cget(option)
|
|
|
|
@t.tagcget(@id, option)
|
|
|
|
end
|
* 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
2008-06-10 20:59:10 +00:00
|
|
|
def cget_strict(option)
|
|
|
|
@t.tagcget_strict(@id, option)
|
|
|
|
end
|
2006-11-06 06:56:37 +00:00
|
|
|
|
|
|
|
def configure(key, value=None)
|
|
|
|
@t.tagconfigure(@id, key, value)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def configinfo(key=nil)
|
|
|
|
@t.tagconfiginfo(@id, key)
|
|
|
|
end
|
|
|
|
|
|
|
|
def current_configinfo(key=nil)
|
|
|
|
@t.current_tagconfiginfo(@id, key)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
########################
|
|
|
|
|
2005-03-05 07:35:41 +00:00
|
|
|
class Tk::Tile::Treeview < TkWindow
|
|
|
|
include Tk::Tile::TileWidget
|
|
|
|
include Scrollable
|
|
|
|
|
2005-08-02 21:05:17 +00:00
|
|
|
include Tk::Tile::TreeviewConfig
|
2005-03-05 07:35:41 +00:00
|
|
|
|
|
|
|
if Tk::Tile::USE_TTK_NAMESPACE
|
|
|
|
TkCommandNames = ['::ttk::treeview'.freeze].freeze
|
|
|
|
else
|
|
|
|
TkCommandNames = ['::treeview'.freeze].freeze
|
|
|
|
end
|
|
|
|
WidgetClassName = 'Treeview'.freeze
|
|
|
|
WidgetClassNames[WidgetClassName] = self
|
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
def __destroy_hook__
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 05:25:12 +00:00
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
|
|
|
|
Tk::Tile::Treeview::Item::ItemID_TBL.delete(@path)
|
|
|
|
}
|
|
|
|
Tk::Tile::Treeview::Tag::ItemID_TBL.mutex.synchronize{
|
|
|
|
Tk::Tile::Treeview::Tag::ItemID_TBL.delete(@path)
|
|
|
|
}
|
2006-11-06 06:56:37 +00:00
|
|
|
end
|
|
|
|
|
2005-04-09 09:27:54 +00:00
|
|
|
def self.style(*args)
|
|
|
|
[self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
|
|
|
|
end
|
|
|
|
|
2005-03-05 07:35:41 +00:00
|
|
|
def tagid(id)
|
2006-11-06 06:56:37 +00:00
|
|
|
if id.kind_of?(Tk::Tile::Treeview::Item) ||
|
|
|
|
id.kind_of?(Tk::Tile::Treeview::Tag)
|
|
|
|
id.id
|
|
|
|
elsif id.kind_of?(Array)
|
2008-06-19 07:08:06 +00:00
|
|
|
# size is 2 or 3
|
|
|
|
id[0..-2] << _get_eval_string(id[-1])
|
2005-08-02 21:05:17 +00:00
|
|
|
else
|
|
|
|
_get_eval_string(id)
|
|
|
|
end
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
def root
|
|
|
|
Tk::Tile::Treeview::Root.new(self)
|
|
|
|
end
|
|
|
|
|
2006-10-04 09:52:54 +00:00
|
|
|
def bbox(item, column=None)
|
|
|
|
list(tk_send('item', 'bbox', item, column))
|
|
|
|
end
|
|
|
|
|
2005-03-05 07:35:41 +00:00
|
|
|
def children(item)
|
2006-11-06 06:56:37 +00:00
|
|
|
simplelist(tk_send_without_enc('children', item)).collect{|id|
|
|
|
|
Tk::Tile::Treeview::Item.id2obj(self, id)
|
|
|
|
}
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
2005-08-02 21:05:17 +00:00
|
|
|
def set_children(item, *items)
|
|
|
|
tk_send_without_enc('children', item,
|
|
|
|
array2tk_list(items.flatten, true))
|
|
|
|
self
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def delete(*items)
|
2005-08-02 21:05:17 +00:00
|
|
|
tk_send_without_enc('delete', array2tk_list(items.flatten, true))
|
2005-03-05 07:35:41 +00:00
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def detach(*items)
|
2005-08-02 21:05:17 +00:00
|
|
|
tk_send_without_enc('detach', array2tk_list(items.flatten, true))
|
2005-03-05 07:35:41 +00:00
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def exist?(item)
|
2005-08-02 21:05:17 +00:00
|
|
|
bool(tk_send_without_enc('exists', _get_eval_enc_str(item)))
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
def focus_item(item = nil)
|
|
|
|
if item
|
|
|
|
tk_send('focus', item)
|
|
|
|
item
|
|
|
|
else
|
|
|
|
id = tk_send('focus')
|
|
|
|
(id.empty?)? nil: Tk::Tile::Treeview::Item.id2obj(self, id)
|
|
|
|
end
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def identify(x, y)
|
2006-10-04 09:52:54 +00:00
|
|
|
# tile-0.7.2 or previous
|
2005-08-02 21:05:17 +00:00
|
|
|
ret = simplelist(tk_send('identify', x, y))
|
|
|
|
case ret[0]
|
2006-11-06 06:56:37 +00:00
|
|
|
when 'heading', 'separator'
|
2005-08-02 21:05:17 +00:00
|
|
|
ret[-1] = num_or_str(ret[-1])
|
2006-11-06 06:56:37 +00:00
|
|
|
when 'cell'
|
|
|
|
ret[1] = Tk::Tile::Treeview::Item.id2obj(self, ret[1])
|
|
|
|
ret[-1] = num_or_str(ret[-1])
|
|
|
|
when 'item', 'row'
|
|
|
|
ret[1] = Tk::Tile::Treeview::Item.id2obj(self, ret[1])
|
2005-08-02 21:05:17 +00:00
|
|
|
end
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
|
|
|
|
2006-10-04 09:52:54 +00:00
|
|
|
def row_identify(x, y)
|
2006-11-06 06:56:37 +00:00
|
|
|
id = tk_send('identify', 'row', x, y)
|
|
|
|
(id.empty?)? nil: Tk::Tile::Treeview::Item.id2obj(self, id)
|
2006-10-04 09:52:54 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def column_identify(x, y)
|
|
|
|
tk_send('identify', 'column', x, y)
|
|
|
|
end
|
|
|
|
|
2005-03-05 07:35:41 +00:00
|
|
|
def index(item)
|
2005-08-02 21:05:17 +00:00
|
|
|
number(tk_send('index', item))
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
# def insert(parent, idx='end', keys={})
|
|
|
|
# keys = _symbolkey2str(keys)
|
|
|
|
# id = keys.delete('id')
|
|
|
|
# if id
|
|
|
|
# num_or_str(tk_send('insert', parent, idx, '-id', id, *hash_kv(keys)))
|
|
|
|
# else
|
|
|
|
# num_or_str(tk_send('insert', parent, idx, *hash_kv(keys)))
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
def insert(parent, idx='end', keys={})
|
|
|
|
Tk::Tile::Treeview::Item.new(self, parent, idx, keys)
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
# def instate(spec, cmd=Proc.new)
|
|
|
|
# tk_send('instate', spec, cmd)
|
|
|
|
# end
|
|
|
|
# def state(spec=None)
|
|
|
|
# tk_send('state', spec)
|
|
|
|
# end
|
2005-08-02 21:05:17 +00:00
|
|
|
|
2005-03-05 07:35:41 +00:00
|
|
|
def move(item, parent, idx)
|
2005-08-02 21:05:17 +00:00
|
|
|
tk_send('move', item, parent, idx)
|
2005-03-05 07:35:41 +00:00
|
|
|
self
|
|
|
|
end
|
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
def next_item(item)
|
|
|
|
id = tk_send('next', item)
|
|
|
|
(id.empty?)? nil: Tk::Tile::Treeview::Item.id2obj(self, id)
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
def parent_item(item)
|
|
|
|
if (id = tk_send('parent', item)).empty?
|
|
|
|
Tk::Tile::Treeview::Root.new(self)
|
|
|
|
else
|
|
|
|
Tk::Tile::Treeview::Item.id2obj(self, id)
|
|
|
|
end
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
|
|
|
|
2006-11-06 06:56:37 +00:00
|
|
|
def prev_item(item)
|
|
|
|
id = tk_send('prev', item)
|
|
|
|
(id.empty?)? nil: Tk::Tile::Treeview::Item.id2obj(self, id)
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def see(item)
|
2005-08-02 21:05:17 +00:00
|
|
|
tk_send('see', item)
|
2005-03-05 07:35:41 +00:00
|
|
|
self
|
|
|
|
end
|
|
|
|
|
2005-08-02 21:05:17 +00:00
|
|
|
def selection
|
2006-11-06 06:56:37 +00:00
|
|
|
simplelist(tk_send('selection')).collect{|id|
|
|
|
|
Tk::Tile::Treeview::Item.id2obj(self, id)
|
|
|
|
}
|
2005-08-02 21:05:17 +00:00
|
|
|
end
|
|
|
|
alias selection_get selection
|
|
|
|
|
2005-03-05 07:35:41 +00:00
|
|
|
def selection_add(*items)
|
2005-08-02 21:05:17 +00:00
|
|
|
tk_send('selection', 'add', array2tk_list(items.flatten, true))
|
2005-03-05 07:35:41 +00:00
|
|
|
self
|
|
|
|
end
|
|
|
|
def selection_remove(*items)
|
2005-08-02 21:05:17 +00:00
|
|
|
tk_send('selection', 'remove', array2tk_list(items.flatten, true))
|
2005-03-05 07:35:41 +00:00
|
|
|
self
|
|
|
|
end
|
|
|
|
def selection_set(*items)
|
2005-08-02 21:05:17 +00:00
|
|
|
tk_send('selection', 'set', array2tk_list(items.flatten, true))
|
2005-03-05 07:35:41 +00:00
|
|
|
self
|
|
|
|
end
|
|
|
|
def selection_toggle(*items)
|
2005-08-02 21:05:17 +00:00
|
|
|
tk_send('selection', 'toggle', array2tk_list(items.flatten, true))
|
2005-03-05 07:35:41 +00:00
|
|
|
self
|
|
|
|
end
|
|
|
|
|
* ext/tk/extconf.rb: improbe messages [ruby-core:06325].
* ext/tk/lib/tk.rb, ext/tk/lib/tk/canvas.rb, ext/tk/lib/tk/entry.rb,
ext/tk/lib/tk/frame.rb, ext/tk/lib/tk/image.rb,
ext/tk/lib/tk/itemconfig.rb, ext/tk/lib/tk/labelframe.rb,
ext/tk/lib/tk/listbox.rb, ext/tk/lib/tk/menu.rb,
ext/tk/lib/tk/radiobutton.rb, ext/tk/lib/tk/scale.rb,
ext/tk/lib/tk/spinbox.rb, ext/tk/lib/tk/text.rb,
ext/tk/lib/tk/toplevel.rb: improve conversion of option values.
* ext/tk/lib/tkextlib/*: ditto.
* ext/tk/lib/tkextlib/*: update to support ActiveTcl8.4.11.2.
* ext/tk/lib/tkextlib/trofs/*: support Trofs 0.4.3.
* ext/tk/lib/tkextlib/tile/*: support Tile 0.7.2.
* ext/tk/lib/tkextlib/vu/*: support vu 2.3.0.
* ext/tk/lib/tkextlib/tcllib/*: support Tcllib 1.8 (Tklib 0.3).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-22 22:17:08 +00:00
|
|
|
def get_directory(item)
|
|
|
|
# tile-0.7+
|
|
|
|
ret = []
|
|
|
|
lst = simplelist(tk_send('set', item))
|
|
|
|
until lst.empty?
|
|
|
|
col = lst.shift
|
|
|
|
val = lst.shift
|
|
|
|
ret << [col, val]
|
|
|
|
end
|
|
|
|
ret
|
|
|
|
end
|
2006-10-04 09:52:54 +00:00
|
|
|
alias get_dictionary get_directory
|
|
|
|
|
2005-03-05 07:35:41 +00:00
|
|
|
def get(item, col)
|
2005-08-02 21:05:17 +00:00
|
|
|
tk_send('set', item, col)
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
|
|
|
def set(item, col, value)
|
2005-08-02 21:05:17 +00:00
|
|
|
tk_send('set', item, col, value)
|
2005-03-05 07:35:41 +00:00
|
|
|
self
|
|
|
|
end
|
2006-10-04 09:52:54 +00:00
|
|
|
|
|
|
|
def tag_bind(tag, seq, *args)
|
|
|
|
if TkComm._callback_entry?(args[0]) || !block_given?
|
|
|
|
cmd = args.shift
|
|
|
|
else
|
|
|
|
cmd = Proc.new
|
|
|
|
end
|
|
|
|
_bind([@path, 'tag', 'bind', tag], seq, cmd, *args)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
alias tagbind tag_bind
|
|
|
|
|
|
|
|
def tag_bind_append(tag, seq, *args)
|
|
|
|
if TkComm._callback_entry?(args[0]) || !block_given?
|
|
|
|
cmd = args.shift
|
|
|
|
else
|
|
|
|
cmd = Proc.new
|
|
|
|
end
|
|
|
|
_bind_append([@path, 'tag', 'bind', tag], seq, cmd, *args)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
alias tagbind_append tag_bind_append
|
|
|
|
|
|
|
|
def tag_bind_remove(tag, seq)
|
|
|
|
_bind_remove([@path, 'tag', 'bind', tag], seq)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
alias tagbind_remove tag_bind_remove
|
|
|
|
|
|
|
|
def tag_bindinfo(tag, context=nil)
|
|
|
|
_bindinfo([@path, 'tag', 'bind', tag], context)
|
|
|
|
end
|
|
|
|
alias tagbindinfo tag_bindinfo
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|