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