2005-04-09 05:27:54 -04:00
|
|
|
#
|
|
|
|
# tpaned widget
|
|
|
|
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
|
|
|
|
#
|
|
|
|
require 'tk'
|
|
|
|
require 'tkextlib/tile.rb'
|
|
|
|
|
|
|
|
module Tk
|
|
|
|
module Tile
|
|
|
|
class TPaned < TkWindow
|
|
|
|
end
|
2007-12-21 03:57:35 -05:00
|
|
|
PanedWindow = Panedwindow = Paned = TPaned
|
2005-04-09 05:27:54 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-03-05 22:56:38 -05:00
|
|
|
Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Panedwindow,
|
* 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 13:44:31 -05:00
|
|
|
:TkPanedwindow, :TkPanedWindow)
|
|
|
|
|
|
|
|
|
2005-04-09 05:27:54 -04:00
|
|
|
class Tk::Tile::TPaned < TkWindow
|
|
|
|
include Tk::Tile::TileWidget
|
|
|
|
|
|
|
|
if Tk::Tile::USE_TTK_NAMESPACE
|
2007-12-21 03:57:35 -05:00
|
|
|
if Tk::Tile::TILE_SPEC_VERSION_ID < 8
|
|
|
|
TkCommandNames = ['::ttk::paned'.freeze].freeze
|
|
|
|
else
|
|
|
|
TkCommandNames = ['::ttk::panedwindow'.freeze].freeze
|
|
|
|
end
|
2005-04-09 05:27:54 -04:00
|
|
|
else
|
|
|
|
TkCommandNames = ['::tpaned'.freeze].freeze
|
|
|
|
end
|
|
|
|
WidgetClassName = 'TPaned'.freeze
|
|
|
|
WidgetClassNames[WidgetClassName] = self
|
|
|
|
|
|
|
|
def self.style(*args)
|
|
|
|
[self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
|
|
|
|
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 16:59:10 -04:00
|
|
|
def add(*args)
|
|
|
|
keys = args.pop
|
|
|
|
fail ArgumentError, "no window in arguments" unless keys
|
|
|
|
|
|
|
|
if keys && keys.kind_of?(Hash)
|
|
|
|
fail ArgumentError, "no window in arguments" if args == []
|
|
|
|
opts = hash_kv(keys)
|
|
|
|
else
|
|
|
|
args.push(keys) if keys
|
|
|
|
opts = []
|
|
|
|
end
|
|
|
|
|
|
|
|
args.each{|win|
|
|
|
|
tk_send_without_enc('add', _epath(win), *opts)
|
|
|
|
}
|
2005-04-09 05:27:54 -04:00
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def forget(pane)
|
|
|
|
pane = _epath(pane)
|
|
|
|
tk_send_without_enc('forget', pane)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def insert(pos, win, keys)
|
|
|
|
win = _epath(win)
|
|
|
|
tk_send_without_enc('insert', pos, win, *hash_kv(keys))
|
|
|
|
self
|
|
|
|
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 16:59:10 -04:00
|
|
|
def panecget_strict(pane, slot)
|
2005-04-09 05:27:54 -04:00
|
|
|
pane = _epath(pane)
|
|
|
|
tk_tcl2ruby(tk_send_without_enc('pane', pane, "-#{slot}"))
|
|
|
|
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 16:59:10 -04:00
|
|
|
alias pane_cget_strict panecget_strict
|
|
|
|
|
|
|
|
def panecget(pane, slot)
|
|
|
|
unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
|
|
|
|
panecget_strict(pane, slot)
|
|
|
|
else
|
|
|
|
begin
|
|
|
|
panecget_strict(pane, slot)
|
|
|
|
rescue => e
|
|
|
|
begin
|
|
|
|
if current_paneconfiginfo(pane).has_key?(slot.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
|
|
|
|
end
|
|
|
|
end
|
2005-04-09 05:27:54 -04:00
|
|
|
alias pane_cget panecget
|
|
|
|
|
|
|
|
def paneconfigure(pane, key, value=nil)
|
|
|
|
pane = _epath(pane)
|
|
|
|
if key.kind_of? Hash
|
|
|
|
params = []
|
|
|
|
key.each{|k, v|
|
|
|
|
params.push("-#{k}")
|
|
|
|
# params.push((v.kind_of?(TkObject))? v.epath: v)
|
|
|
|
params.push(_epath(v))
|
|
|
|
}
|
|
|
|
tk_send_without_enc('pane', pane, *params)
|
|
|
|
else
|
|
|
|
# value = value.epath if value.kind_of?(TkObject)
|
|
|
|
value = _epath(value)
|
|
|
|
tk_send_without_enc('pane', pane, "-#{key}", value)
|
|
|
|
end
|
|
|
|
self
|
|
|
|
end
|
|
|
|
alias pane_config paneconfigure
|
|
|
|
alias pane_configure paneconfigure
|
|
|
|
|
|
|
|
def paneconfiginfo(win)
|
|
|
|
if TkComm::GET_CONFIGINFO_AS_ARRAY
|
|
|
|
win = _epath(win)
|
|
|
|
if key
|
|
|
|
conf = tk_split_list(tk_send_without_enc('pane', win, "-#{key}"))
|
|
|
|
conf[0] = conf[0][1..-1]
|
|
|
|
if conf[0] == 'hide'
|
|
|
|
conf[3] = bool(conf[3]) unless conf[3].empty?
|
|
|
|
conf[4] = bool(conf[4]) unless conf[4].empty?
|
|
|
|
end
|
|
|
|
conf
|
|
|
|
else
|
2009-03-05 22:56:38 -05:00
|
|
|
tk_split_simplelist(tk_send_without_enc('pane',
|
2005-04-09 05:27:54 -04:00
|
|
|
win)).collect{|conflist|
|
|
|
|
conf = tk_split_simplelist(conflist)
|
|
|
|
conf[0] = conf[0][1..-1]
|
|
|
|
if conf[3]
|
|
|
|
if conf[0] == 'hide'
|
|
|
|
conf[3] = bool(conf[3]) unless conf[3].empty?
|
|
|
|
elsif conf[3].index('{')
|
2009-03-05 22:56:38 -05:00
|
|
|
conf[3] = tk_split_list(conf[3])
|
2005-04-09 05:27:54 -04:00
|
|
|
else
|
2009-03-05 22:56:38 -05:00
|
|
|
conf[3] = tk_tcl2ruby(conf[3])
|
2005-04-09 05:27:54 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
if conf[4]
|
|
|
|
if conf[0] == 'hide'
|
|
|
|
conf[4] = bool(conf[4]) unless conf[4].empty?
|
|
|
|
elsif conf[4].index('{')
|
2009-03-05 22:56:38 -05:00
|
|
|
conf[4] = tk_split_list(conf[4])
|
2005-04-09 05:27:54 -04:00
|
|
|
else
|
2009-03-05 22:56:38 -05:00
|
|
|
conf[4] = tk_tcl2ruby(conf[4])
|
2005-04-09 05:27:54 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
conf[1] = conf[1][1..-1] if conf.size == 2 # alias info
|
|
|
|
conf
|
|
|
|
}
|
|
|
|
end
|
|
|
|
else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
|
|
|
|
win = _epath(win)
|
|
|
|
if key
|
|
|
|
conf = tk_split_list(tk_send_without_enc('pane', win, "-#{key}"))
|
|
|
|
key = conf.shift[1..-1]
|
|
|
|
if key == 'hide'
|
|
|
|
conf[2] = bool(conf[2]) unless conf[2].empty?
|
|
|
|
conf[3] = bool(conf[3]) unless conf[3].empty?
|
|
|
|
end
|
|
|
|
{ key => conf }
|
|
|
|
else
|
|
|
|
ret = {}
|
2009-03-05 22:56:38 -05:00
|
|
|
tk_split_simplelist(tk_send_without_enc('pane',
|
2005-04-09 05:27:54 -04:00
|
|
|
win)).each{|conflist|
|
|
|
|
conf = tk_split_simplelist(conflist)
|
|
|
|
key = conf.shift[1..-1]
|
|
|
|
if key
|
|
|
|
if key == 'hide'
|
|
|
|
conf[2] = bool(conf[2]) unless conf[2].empty?
|
|
|
|
elsif conf[2].index('{')
|
2009-03-05 22:56:38 -05:00
|
|
|
conf[2] = tk_split_list(conf[2])
|
2005-04-09 05:27:54 -04:00
|
|
|
else
|
2009-03-05 22:56:38 -05:00
|
|
|
conf[2] = tk_tcl2ruby(conf[2])
|
2005-04-09 05:27:54 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
if conf[3]
|
|
|
|
if key == 'hide'
|
|
|
|
conf[3] = bool(conf[3]) unless conf[3].empty?
|
|
|
|
elsif conf[3].index('{')
|
2009-03-05 22:56:38 -05:00
|
|
|
conf[3] = tk_split_list(conf[3])
|
2005-04-09 05:27:54 -04:00
|
|
|
else
|
2009-03-05 22:56:38 -05:00
|
|
|
conf[3] = tk_tcl2ruby(conf[3])
|
2005-04-09 05:27:54 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
if conf.size == 1
|
|
|
|
ret[key] = conf[0][1..-1] # alias info
|
|
|
|
else
|
|
|
|
ret[key] = conf
|
|
|
|
end
|
|
|
|
}
|
|
|
|
ret
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
alias pane_configinfo paneconfiginfo
|
|
|
|
|
|
|
|
def current_paneconfiginfo(win, key=nil)
|
|
|
|
if TkComm::GET_CONFIGINFO_AS_ARRAY
|
|
|
|
if key
|
|
|
|
conf = paneconfiginfo(win, key)
|
|
|
|
{conf[0] => conf[4]}
|
|
|
|
else
|
|
|
|
ret = {}
|
|
|
|
paneconfiginfo(win).each{|conf|
|
|
|
|
ret[conf[0]] = conf[4] if conf.size > 2
|
|
|
|
}
|
|
|
|
ret
|
|
|
|
end
|
|
|
|
else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
|
|
|
|
ret = {}
|
|
|
|
paneconfiginfo(win, key).each{|k, conf|
|
|
|
|
ret[k] = conf[-1] if conf.kind_of?(Array)
|
|
|
|
}
|
|
|
|
ret
|
|
|
|
end
|
|
|
|
end
|
|
|
|
alias current_pane_configinfo current_paneconfiginfo
|
|
|
|
|
|
|
|
def identify(x, y)
|
|
|
|
list(tk_send_without_enc('identify', x, y))
|
|
|
|
end
|
|
|
|
|
|
|
|
def sashpos(idx, newpos=None)
|
|
|
|
num_or_str(tk_send_without_enc('sashpos', idx, newpos))
|
|
|
|
end
|
|
|
|
end
|