I have taken a closer look at how the selection is toggled and cleared,
both on Windows and X11 (Linux):
1. The selection state of the active/current item is toggled with
<Control-space>, both on Windows and Linux. The best examples for this
are Windows Explorer and Task Manager on Windows and similar tools on
Linux. Strangely enough, this shortcut doesn't seem to be widely known.
While the Tk core listbox and Tablelist support <Control-Button-1> in
the extended selection mode only, all Linux tools that I have looked at
support it in single-selection lists, too. I found this quite useful.
2. There is no standard way for clearing the selection (i.e.,
deselecting everything), but many applications support the key sequence
<Shift-Control-A> for this purpose. A few examples: KWrite, Kate, GIMP,
Adobe Flash, and the "Processes" tab in System Monitor on Linux. At
least GIMP and Flash run on Windows, too.
The intensive discussion in this thread has determined me to add a few
new features to Tablelist, aimed at improving its user-friendliness and
compatibility with other frameworks. Those bindings that are not
strictly listbox-compatible are only enabled if the new boolean variable
tablelist::strictTk is false. However, since the default value of this
variable is 0, the new features will be enabled per default.
A few snippets from the updated reference manual:
-----
*BINDINGS FOR THE SELECTION TYPE row:* ...
1. If tablelist::strictTk is false (which is the default) then
pressing button 1 with the Control key down toggles the selection state
of the item under the mouse. If the selection mode is extended then
additional actions apply, as described in the listbox manual entry. If
the selection mode is single or browse and the selection state of the
item changes from unselected to selected then any other selected items
will be deselected, just as if button 1 had been pressed without the
Control key down.
2. Again, if tablelist::strictTk is false, then Control-space and
Control-Select toggle the selection state of the active item just as if
button 1 had been pressed over this item with the Control key down.
*BINDINGS FOR THE SELECTION TYPE cell:* ...
(similar)
*BINDINGS FOR SELECT ALL AND DESELECT ALL:* The following additional
bindings associated with the binding tag TablelistBody are valid on the
windowing systems x11 and win32:
1. Control-a behaves the same as Control-slash, i.e., it selects
everything in the widget, except in single and browse modes, in which
case it selects the active item or element (depending on the selection
type) and deselects everything else.
REMARK 1: The default widget bindings in current Tk versions on
Windows already support Control-a as an alternative to Control-slash.
In Tablelist this is now valid on X11, too.
REMARK 2: On Mac OS X Aqua, the default widget bindings in
current Tk versions use the key sequence Command-a instead of Control-slash.
2. Shift-Control-A behaves the same as Control-backslash, i.e., it
deselects everything in the widget, except in browse mode where it has
no effect.
REMARK 1: This shortcut comes in handy on Windows when using,
e.g., a French or German keyboard, because in this case Tk fails to
recognize the Control-backslash key sequence (for which one has to press
Control, AltGr, and a third key: _ on a French and ß on a German
keyboard). Moreover, on many keyboards it is quite difficult (if not
even impossible) to generate the Control-backslash key sequence, fact
which makes the support for this alternative shortcut even more useful
on both X11 and Windows.
REMARK 2: On Mac OS X Aqua, the default widget bindings in
current Tk versions use the key sequence Option-Command-a instead of
Control-backslash.
-----
I think that these new features will make the selection handling in
Tablelist widgets much more user-friendly. And I hope that Alexandru
will be happy with them, too. :-)