|
From: Joe E. <jen...@fl...> - 2006-01-30 01:27:32
|
Jeff Hobbs wrote:
> > [JE]:
> > | pathname identify row _x_ _y_
> > | pathname identify column _x_ _y_
> > [...]
>
> Is that the best alternate form though? What if you want to
> know the row and column as an index? You have to make 2
> calls.
From initial experiments, it seems to work pretty well.
Multiple entry points that each return a single value are easier
to work with than a single call that returns multiple values and
having to extract the desired data from the result.
Maybe it's just in contrast with the old [$tv identify] form
(which is really, really horrible), but so far I've found it
pleasant to work with.
> While I agree with using listbox style select modes (which
> tktable uses as well), what do you mean by behavior for
> modifying the selection? Like a double-click to edit mode?
No, just changing the selected/deselected state of tree items.
In-place editing is a nice idea, but out-of-scope for now.
> Another thing that BWidgets
> has that I've used before is -selectable for an item (like
> making root nodes not selectable).
A use case for this is #1328192 "disable item selectability",
where the tree shows files and directories; files should be
selectable, but directories should not.
The solution I had in mind for this was bindable tags: the
application could assign a 'file' tag to file items, a 'dir'
tag to directory items, use [ttk::treeview::selectMode $tv none]
and handle selection entirely in tag bindings:
$tv tag bind file <ButtonPress-1> \
{ %W selection set [%W identify row %x %y] }
Since the 'dir' tag has no such binding, clicking on a directory
item wouldn't select it.
A per-item 'selectable' option is worth considering too;
need to investigate how that interacts with everything else.
(More on tags later...)
--Joe English
|