ttk::notebook(n) | Tk Themed Widget | ttk::notebook(n) |
ttk::notebook - Multi-paned container widget
ttk::notebook pathname ?options...? pathname add window ?options...? pathname insert index window ?options...?
A ttk::notebook widget manages a collection of windows and displays a single one at a time. Each slave window is associated with a tab, which the user may select to change the currently-displayed window.
-class -cursor -takefocus -style
See the ttk_widget manual entry for details on the standard options.
[-height height] If present and greater than zero, specifies the desired height of the pane area (not including internal padding or tabs). Otherwise, the maximum height of all panes is used. [-padding padding] Specifies the amount of extra space to add around the outside of the notebook. The padding is a list of up to four length specifications left top right bottom. If fewer than four elements are specified, bottom defaults to top, right defaults to left, and top defaults to left. [-width width] If present and greater than zero, specifies the desired width of the pane area (not including internal padding). Otherwise, the maximum width of all panes is used.
The following options may be specified for individual notebook panes: [-state state] Either normal, disabled or hidden. If disabled, then the tab is not selectable. If hidden, then the tab is not shown. [-sticky sticky] Specifies how the slave window is positioned within the pane area. Value is a string containing zero or more of the characters n, s, e, or w. Each letter refers to a side (north, south, east, or west) that the slave window will “stick” to, as per the grid geometry manager. [-padding padding] Specifies the amount of extra space to add between the notebook and this pane. Syntax is the same as for the widget -padding option. [-text text] Specifies a string to be displayed in the tab. [-image image] Specifies an image to display in the tab. See ttk_widget(n) for details. [-compound compound] Specifies how to display the image relative to the text, in the case both -text and -image are present. See label(n) for legal values. [-underline underline] Specifies the integer index (0-based) of a character to underline in the text string. The underlined character is used for mnemonic activation if ttk::notebook::enableTraversal is called.
The tabid argument to the following commands may take any of the following forms:
To enable keyboard traversal for a toplevel window containing a notebook widget $nb, call:
ttk::notebook::enableTraversal $nb
This will extend the bindings for the toplevel window containing the notebook as follows:
Multiple notebooks in a single toplevel may be enabled for traversal, including nested notebooks. However, notebook traversal only works properly if all panes are direct children of the notebook.
The notebook widget generates a <<NotebookTabChanged>> virtual event after a new tab is selected.
pack [ttk::notebook .nb] ttk::notebook::enableTraversal .nb
ttk::widget(n), grid(n)
pane, tab
8.5 | Tk |