|
From: Joe E. <jen...@fl...> - 2006-01-29 20:16:41
|
First off: the syntax of the [$tv identify] command is
being replaced with something more sensible.
The new syntax is:
| pathname identify _component_ _x_ _y_
| Returns a description of the specified component under the point given
| by x and y, or the empty string if no such component is present at
| that position. The following subcommands are supported:
|
| pathname identify row _x_ _y_
| Returns the item ID of the item at position y.
|
| pathname identify column _x_ _y_
| Returns the data column identifier of the cell at position x.
| The tree column has ID #0.
More subcommands will be added as needed, these two seem
to be the most useful. The old, horrible, 4-argument form
[$tv identify $x $y] will stick around for a while, but
I hope to phase it out as soon as it's convenient to do so.
Next: the built-in selection behavior is only appropriate
for (at most) 75% of the typical use cases (see #1328192,
#1389202). To make things worse, it's really, *really* hard
for applications to change things -- partly because [$tv identify]
is so horrible, but mostly because the selection logic
is tightly coupled to the rest of the bindings.
So, new plan: The ttk::treeview's default bindings will not
include any behavior for modifying the selection (this is
how the BWidget Tree works). There will be a small set of
predefined selection modes (to be determined, will probably
include 'single', 'multiple', and 'extended' a la the core Listbox
widget). Selection modes can be activated with:
ttk::treeview::selectMode $tv $mode
This procedure will (probably) be implemented by adjusting
the widget's bindtags; I haven't worked out the details yet.
As a transition strategy, the default bindings will remain
as they are for the rest of the 0.7 series, and [ttk::treeview::selectMode]
will be available (initially) as a no-op. Existing code
should add calls to [ttk::treeview::selectMode $tv multiple]
at their earliest convenience to ensure forward-compatibility
when 0.8 comes out.
Sound reasonable? Any comments?
--Joe English
jen...@fl...
|