|
From: Joe E. <jen...@fl...> - 2006-01-30 06:08:46
|
Jeff Hobbs wrote:
> You mean not having a 'selection' subcommand?!?! That doesn't
> seem like a good idea to me. All widgets must have that
> basic level of control, and I don't see how you'd implement
> your select modes without it yourself.
I'm apparently not explaining myself very well :-)
Let me try again:
Right now, the ttk::treeview widget uses something similar
to the listbox "extended" selection mode:
<ButtonPress-1>:
Sets the selection and focus.
<Shift-ButtonPress-1>:
Extends the selection ("addition" mode)
<Control-ButtonPress-1>:
Toggle the selected state of the identified item.
This behavior is built in to the Treeview class bindings.
The built-in behavior is not always suitable. It is
currently very difficult for an application to change
the built-in behavior.
Proposed change: The built-in Treeview class bindings will
no longer include that behavior. Applications will be able
to explicitly enable it by calling:
ttk::treeview::selectMode $tv multiple
Other selection models will be provided, including "single",
"extended", and possibly others. Applications will be able
to explicitly enable those behaviors instead by calling:
ttk::treeview::selectMode $tv $othermode
If an application does not explicitly enable a selection mode for
a particular ttk::treeview widget, it will act like the BWidget Tree.
That is: none of the built-in Treeview class bindings will cause
items to be added or removed from the selection. Applications
can add their own widget bindings for selecting and deselecting items
(like with the BWidget Tree), or, as above, they can enable
one of the predefined selection modes with [ttk::treeview::selectMode]
The implementation of [ttk::treeview::selectMode $tv] will involve
modifying $tv's bindtags. This will make it easier for applications
to define their own selection modes as well.
The proposed change only affects the Treeview widget class bindings.
No widget commands will be harmed in the making of this change.
(Except for [$tv identify], which deserves it, since it's really
horrible.)
Summarizing: clicking on an item in a treeview widget will
no longer select that item unless the application explicitly
says so. Convenience routines will be provided to enable
commonly-used selection modes. This only affects the default
Treeview widget class bindings.
Make sense now?
--Joe
|