1ttk::notebook(n) Tk Themed Widget ttk::notebook(n)
2
3
4
5______________________________________________________________________________
6
8 ttk::notebook - Multi-paned container widget
9
11 ttk::notebook pathName ?options...?
12 pathName add window ?options...?
13 pathName insert index window ?options...?
14_________________________________________________________________
15
17 A ttk::notebook widget manages a collection of windows and displays a
18 single one at a time. Each slave window is associated with a tab,
19 which the user may select to change the currently-displayed window.
20
22 -class -cursor -takefocus
23 -style
24
25 See the ttk_widget manual entry for details on the standard options.
26
28 [-height height] If present and greater than zero, specifies the
29 desired height of the pane area (not including internal padding or
30 tabs). Otherwise, the maximum height of all panes is used. [-pad‐
31 ding padding] Specifies the amount of extra space to add around the
32 outside of the notebook. The padding is a list of up to four length
33 specifications left top right bottom. If fewer than four elements are
34 specified, bottom defaults to top, right defaults to left, and top
35 defaults to left. [-width width] If present and greater than zero,
36 specifies the desired width of the pane area (not including internal
37 padding). Otherwise, the maximum width of all panes is used.
38
40 The following options may be specified for individual notebook panes:
41 [-state state] Either normal, disabled or hidden. If disabled, then
42 the tab is not selectable. If hidden, then the tab is not shown.
43 [-sticky sticky] Specifies how the slave window is positioned within
44 the pane area. Value is a string containing zero or more of the char‐
45 acters n, s, e, or w. Each letter refers to a side (north, south,
46 east, or west) that the slave window will “stick” to, as per the grid
47 geometry manager. [-padding padding] Specifies the amount of extra
48 space to add between the notebook and this pane. Syntax is the same as
49 for the widget -padding option. [-text text] Specifies a string to be
50 displayed in the tab. [-image image] Specifies an image to display in
51 the tab. See ttk_widget(n) for details. [-compound compound] Speci‐
52 fies how to display the image relative to the text, in the case both
53 -text and -image are present. See label(n) for legal values. [-under‐
54 line underline] Specifies the integer index (0-based) of a character to
55 underline in the text string. The underlined character is used for
56 mnemonic activation if ttk::notebook::enableTraversal is called.
57
59 The tabid argument to the following commands may take any of the fol‐
60 lowing forms:
61
62 · An integer between zero and the number of tabs;
63
64 · The name of a slave window;
65
66 · A positional specification of the form “@x,y”, which identifies
67 the tab
68
69 · The literal string “current”, which identifies the currently-
70 selected tab; or:
71
72 · The literal string “end”, which returns the number of tabs (only
73 valid for “pathname index”).
74
76 pathname add window ?options...?
77 Adds a new tab to the notebook. See TAB OPTIONS for the list of
78 available options. If window is currently managed by the note‐
79 book but hidden, it is restored to its previous position.
80
81 pathname configure ?options?
82 See ttk::widget(n).
83
84 pathname cget option
85 See ttk::widget(n).
86
87 pathname forget tabid
88 Removes the tab specified by tabid, unmaps and unmanages the
89 associated window.
90
91 pathname hide tabid
92 Hides the tab specified by tabid. The tab will not be dis‐
93 played, but the associated window remains managed by the note‐
94 book and its configuration remembered. Hidden tabs may be
95 restored with the add command.
96
97 pathName identify x y
98 Returns the name of the element at position x, y. See ttk::wid‐
99 get(n).
100
101 pathname index tabid
102 Returns the numeric index of the tab specified by tabid, or the
103 total number of tabs if tabid is the string “end”.
104
105 pathname insert pos subwindow options...
106 Inserts a pane at the specified position. pos is either the
107 string end, an integer index, or the name of a managed subwin‐
108 dow. If subwindow is already managed by the notebook, moves it
109 to the specified position. See TAB OPTIONS for the list of
110 available options.
111
112 pathname instate statespec ?script...?
113 See ttk::widget(n).
114
115 pathname select ?tabid?
116 Selects the specified tab. The associated slave window will be
117 displayed, and the previously-selected window (if different) is
118 unmapped. If tabid is omitted, returns the widget name of the
119 currently selected pane.
120
121 pathname state ?statespec?
122 See ttk::widget(n).
123
124 pathname tab tabid ?-option ?value ...
125 Query or modify the options of the specific tab. If no -option
126 is specified, returns a dictionary of the tab option values. If
127 one -option is specified, returns the value of that option.
128 Otherwise, sets the -options to the corresponding values. See
129 TAB OPTIONS for the available options.
130
131 pathname tabs
132 Returns the list of windows managed by the notebook.
133
135 To enable keyboard traversal for a toplevel window containing a note‐
136 book widget $nb, call:
137 ttk::notebook::enableTraversal $nb
138
139 This will extend the bindings for the toplevel window containing the
140 notebook as follows:
141
142 · Control-Tab selects the tab following the currently selected
143 one.
144
145 · Shift-Control-Tab selects the tab preceding the currently
146 selected one.
147
148 · Alt-K, where K is the mnemonic (underlined) character of any
149 tab, will select that tab.
150
151 Multiple notebooks in a single toplevel may be enabled for traversal,
152 including nested notebooks. However, notebook traversal only works
153 properly if all panes are direct children of the notebook.
154
156 The notebook widget generates a <<NotebookTabChanged>> virtual event
157 after a new tab is selected.
158
160 pack [ttk::notebook .nb]
161 ttk::notebook::enableTraversal .nb
162
164 ttk::widget(n), grid(n)
165
167 pane, tab
168
169
170
171Tk 8.5 ttk::notebook(n)