Tab group widgets provide functionality similar to Motif tab groups. A Tab group is a frame widget which supports keyboard navigation between its child widgets and between other tab-groups in the same top-level window. They work best when used with focus highlighting.
tabgroup
pathName ?options?
Tab-groups support the same configuration options as frame
widgets
configure
option value ?option value ...?
manage
?option...? widget ?widget...?
<Right>
, <Down>
<Left>
, <Up>
<Tab>
, <Control-Tab>
<Shift-Tab>
,
<Control-Shift-Tab>
The option parameters can alter the functions bound to the widgets so as to avoid clashes with any normal bindings the widgets have. Any number of the following options can be specified:
-notab
<Tab>
and
<Shift-Tab>
. However, bindings are still
created for <Control-Tab>
and
<Control-Shift-Tab>
.-nohorizontal
<Left>
or
<Right>
. For instance, this option would be
specified when managing an entry
widget.-novertical
<Up>
or
<Down>
. For instance, this option would be
specified when managing an listbox
widget.-novertical
and -nohorizontal
options
(a text
widget, for example), it should be placed in on
it's own in a separate tab group so that keyboard navigation can be
performed using the <Control-Tab>
and
<Control-Shift-Tab>
bindings.
unmanage
widget ?widget...?
Currently, it is an error for a tab group to have no managed widgets.
Therefore, if you want to group a number of output-only widgets
(label
or message
widgets for instance, then you
should use a frame
widget. If you want to group a number of
widgets which include one or more input widgets, then use a
tabgroup
widget.
Tab group widgets automate the handling of the focus widget. When receiving the focus, tab group widgets pass the focus to its first managed widget. The tab group module also adds bindings to top level widgets so that when they receive the focus, they pass it to their first tab group.
Note however
that if you create a top level window with a class name other than
TopLevel
, the bindings to focus on the widget's first tab group
will no longer operate. You will have to bind that functionality yourself
with the code:
bind widget <FocusIn> { focus [tabgroup :: first_tabgroup %W] }
Keyboard traversal does not work properly with listbox
widgets, since they have no way of setting the keyboard focus to individual
list items. This problem will be fixed by implementing an Itcl listbox
class; however this hasn't been done yet.