background font selectBackground cursor foreground selectForeground disabledForeground height width
See the options manual entry for details on the standard options.
Name: angle Class: Angle Command-Line Switch: -angle
Name: backdrop Class: Backdrop Command-Line Switch: -backdrop
Name: bevelAmount Class: BevelAmount Command-Line Switch: -bevelamount
Name: command Class: Command Command-Line Switch: -command Specifes the prefix of a Tcl command to invoke to change the view in the widget associated with the tabset. When a user selects a tab, a Tcl command is invoked. The actual command consists of this option followed by a space and a number. The number is the numerical index of the tab that has been selected.
Name: equalTabs Class: EqualTabs Command-Line Switch: -equaltabs
Name: gap Class: Gap Command-Line Switch: -gap
Name: margin Class: Margin Command-Line Switch: -margin
Name: padX Class: PadX Command-Line Switch: -padx
Name: padY Class: PadY Command-Line Switch: -pady
Name: raiseSelect Class: RaiseSelect Command-Line Switch: -raiseselect
Name: start Class: Start Command-Line Switch: -start
Name: state Class: State Command-Line Switch: -state
Name: tabBorders Class: TabBorders Command-Line Switch: -tabborders
Name: tabPos Class: TabPos Command-Line Switch: -tabpos
The tabset command creates a new window (given by the pathName argument) and makes it into a tabset widget. Additional options, described above may be specified on the command line or in the option database to configure aspects of the tabset such as its colors, font, and text. The tabset command returns its pathName argument. At the time this command is invoked, there must not exist a window named pathName, but pathName's parent must exist.
A tabset is a widget that contains a set of Tab buttons. It displays these tabs in a row or column depending on it tabpos. When a tab is clicked on, it becomes the only tab in the tab set that is selected. All other tabs are deselected. The Tcl command prefix associated with this tab (through the command tab configure option) is invoked with the tab index number appended to its argument list. This allows the tabset to control another widget such as a Notebook.
Tabs can be controlled in their location along the edges, the angle that tab sides are drawn with, gap between tabs, starting margin of tabs, internal padding around labels in a tab, the font, and its text or bitmap.
The tabset command creates a new Tcl command whose name is pathName. This command may be used to invoke various operations on the widget. It has the following general form:
pathName option ?arg arg ...?option and the args determine the exact behavior of the command.
Many of the widget commands for a tabset take as one argument an indicator of which tab of the tabset to operate on. These indicators are called indexes and may be specified in any of the following forms:
The following commands are possible for tabset widgets:
Following is an example that creates a tabset with two tabs and a list box that the tabset controls. In addition selecting an item from the list also selects the corresponding tab.
# Define a proc that knows how to select an item
# from a list given an index from the tabset -command callback.
proc selectItem { item } {
.l selection clear [.l curselection]
.l selection set $item
.l see $item
}
# Define a proc that knows how to select a tab
# given a y pixel coordinate from the list..
proc selectTab { y } {
set whichItem [.l nearest $y]
.ts select $whichItem
}
# Create a listbox with two items (one and two)
# and bind button 1 press to the selectTab procedure.
listbox .l -selectmode single -exportselection false
.l insert end one
.l insert end two
.l selection set 0
pack .l
bind .l <ButtonPress-1> { selectTab %y }
# Create a tabset, set its -command to call selectItem
# Add two labels to the tabset (one and two).
tabset .ts -command selectItem
.ts add -label 1
.ts add -label 2
.ts select 0
pack .ts -fill x -expand no