|
From: Joe E. <jen...@fl...> - 2004-09-27 16:45:11
|
Did some more work on this over the weekend. I'm pretty happy
with the current data model; the primitives provided seem just
about right.
The display and interaction model needs work next.
At a minimum, the widget should support an 'active' item
and a set of 'selected' items like the listbox widget.
We might want to support column selections as well.
It also needs a set of virtual events and/or callbacks
to report interactions, and a way to associate commands
with column headings, plus whatever internal mechanisms
are necessary to make headings look and act like pushbuttons.
Jeff Hobbs made a suggestion about item tags. I'm waiting
for him to elaborate on that idea :-) but it sounds like
a promising approach.
If anyone has use cases for the widget, now would be a good
time to post them.
Updated manpage here:
<URL: http://tktable.sourceforge.net/tile/doc/treeview.html >
New stuff since first draft:
+ Added 'column' command to query/configure column attributes.
+ Added 'set' command to query/set item values.
+ Added 'exists' command
+ Added 'move', 'next', and 'prev' commands
Changes since first draft:
+ The 'insert' command now has the form:
$tree insert $parent $index ?-id $id? ...options....
This worked out better.
+ 'remove' is now 'detach' as per AKU's suggestion.
+ 'delete' now takes a list of items.
+ 'children' takes an optional fourth argument; if supplied
it replaces the list of children.
+ -columns is always a list of column names. It's also
a read-only option now, and can only be set at widget
creation time [*].
+ The -width option is gone; instead the width is calculated
from the sum of the widths of the -displaycolumns and
the tree column #0 [**].
+ As discussed earlier, 'itemconfigure' and 'itemcget'
have been replaced with an 'item' data accessor.
'open', 'close', and 'opened' widget commands have been
replaced with '-open' item option.
+ Clarified meaning of out-of-range $index values:
if $index < 0, insert at the beginning, if >= #children
append to end.
--Joe English
jen...@fl...
[*] The main reason for making -columns readonly is to prevent
the widget from getting into an inconsistent state under certain
error conditions. If this is a problem, I'll try to figure
out how to avoid the inconsistency or just live with it --
it's not a fatal condition, just a possibly confusing one.
[**] -width will probably need to be added back in again later;
I anticipate problems with interactive column resizing.
|