1ttk::notebook(n)               Tk Themed Widget               ttk::notebook(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       ttk::notebook - Multi-paned container widget
9

SYNOPSIS

11       ttk::notebook pathname ?options...?
12       pathname add window ?options...?
13       pathname insert index window ?options...?
14______________________________________________________________________________
15

DESCRIPTION

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

STANDARD OPTIONS

22       -class                -cursor              -takefocus
23       -style
24
25       See the ttk_widget manual entry for details on the standard options.
26

WIDGET-SPECIFIC OPTIONS

28       Command-Line Name:-height
29       Database Name:  height
30       Database Class: Height
31
32              If  present  and greater than zero, specifies the desired height
33              of the pane area (not including internal padding or tabs).  Oth‐
34              erwise, the maximum height of all panes is used.
35
36       Command-Line Name:-padding
37       Database Name:  padding
38       Database Class: Padding
39
40              Specifies the amount of extra space to add around the outside of
41              the notebook.  The padding is a list of up to four length speci‐
42              fications  left  top  right bottom.  If fewer than four elements
43              are specified, bottom defaults to top, right defaults  to  left,
44              and  top defaults to left.  In other words, a list of three num‐
45              bers specify the left, vertical, and right padding;  a  list  of
46              two  numbers  specify the horizontal and the vertical padding; a
47              single number specifies the same padding all the way around  the
48              widget.
49
50       Command-Line Name:-width
51       Database Name:  width
52       Database Class: Width
53
54              If present and greater than zero, specifies the desired width of
55              the pane area (not including internal padding).  Otherwise,  the
56              maximum width of all panes is used.
57

TAB OPTIONS

59       The following options may be specified for individual notebook panes:
60
61       Command-Line Name:-state
62       Database Name:  state
63       Database Class: State
64
65              Either normal, disabled or hidden.  If disabled, then the tab is
66              not selectable.  If hidden, then the tab is not shown.
67
68       Command-Line Name:-sticky
69       Database Name:  sticky
70       Database Class: Sticky
71
72              Specifies how the slave window is  positioned  within  the  pane
73              area.   Value is a string containing zero or more of the charac‐
74              ters n, s, e, or w.  Each letter refers to a side (north, south,
75              east, or west) that the slave window will “stick” to, as per the
76              grid geometry manager.
77
78       Command-Line Name:-padding
79       Database Name:  padding
80       Database Class: Padding
81
82              Specifies the amount of extra space to add between the  notebook
83              and  this  pane.   Syntax is the same as for the widget -padding
84              option.
85
86       Command-Line Name:-text
87       Database Name:  text
88       Database Class: Text
89
90              Specifies a string to be displayed in the tab.
91
92       Command-Line Name:-image
93       Database Name:  image
94       Database Class: Image
95
96              Specifies an image to display in the tab.  See ttk_widget(n) for
97              details.
98
99       Command-Line Name:-compound
100       Database Name:  compound
101       Database Class: Compound
102
103              Specifies  how to display the image relative to the text, in the
104              case both -text and -image are present.  See label(n) for  legal
105              values.
106
107       Command-Line Name:-underline
108       Database Name:  underline
109       Database Class: Underline
110
111              Specifies  the  integer index (0-based) of a character to under‐
112              line in the text string.  The underlined character is  used  for
113              mnemonic activation if ttk::notebook::enableTraversal is called.
114

TAB IDENTIFIERS

116       The  tabid  argument to the following commands may take any of the fol‐
117       lowing forms:
118
119       ·      An integer between zero and the number of tabs;
120
121       ·      The name of a slave window;
122
123       ·      A positional specification of the form “@x,y”, which  identifies
124              the tab
125
126       ·      The  literal  string  “current”, which identifies the currently-
127              selected tab; or:
128
129       ·      The literal string “end”, which returns the number of tabs (only
130              valid for “pathname index”).
131

WIDGET COMMAND

133       pathname add window ?options...?
134              Adds a new tab to the notebook.  See TAB OPTIONS for the list of
135              available options.  If window is currently managed by the  note‐
136              book but hidden, it is restored to its previous position.
137
138       pathname configure ?options?
139              See ttk::widget(n).
140
141       pathname cget option
142              See ttk::widget(n).
143
144       pathname forget tabid
145              Removes  the  tab  specified  by tabid, unmaps and unmanages the
146              associated window.
147
148       pathname hide tabid
149              Hides the tab specified by tabid.  The  tab  will  not  be  dis‐
150              played,  but  the associated window remains managed by the note‐
151              book and its  configuration  remembered.   Hidden  tabs  may  be
152              restored with the add command.
153
154       pathname identify component x y
155              Returns  the  name of the element under the point given by x and
156              y, or the empty string if no component is present at that  loca‐
157              tion.  The following subcommands are supported:
158
159              pathname identify element x y
160                     Returns  the  name  of the element at the specified loca‐
161                     tion.
162
163              pathname identify tab x y
164                     Returns the index of the tab at the specified location.
165
166       pathname index tabid
167              Returns the numeric index of the tab specified by tabid, or  the
168              total number of tabs if tabid is the string “end”.
169
170       pathname insert pos subwindow options...
171              Inserts  a  pane  at  the specified position.  pos is either the
172              string end, an integer index, or the name of a  managed  subwin‐
173              dow.   If subwindow is already managed by the notebook, moves it
174              to the specified position.  See TAB  OPTIONS  for  the  list  of
175              available options.
176
177       pathname instate statespec ?script...?
178              See ttk::widget(n).
179
180       pathname select ?tabid?
181              Selects  the specified tab.  The associated slave window will be
182              displayed, and the previously-selected window (if different)  is
183              unmapped.   If  tabid is omitted, returns the widget name of the
184              currently selected pane.
185
186       pathname state ?statespec?
187              See ttk::widget(n).
188
189       pathname tab tabid ?-option ?value ...
190              Query or modify the options of the specific tab.  If no  -option
191              is specified, returns a dictionary of the tab option values.  If
192              one -option is specified, returns  the  value  of  that  option.
193              Otherwise,  sets  the -options to the corresponding values.  See
194              TAB OPTIONS for the available options.
195
196       pathname tabs
197              Returns the list of windows managed  by  the  notebook,  in  the
198              index order of their associated tabs.
199

KEYBOARD TRAVERSAL

201       To  enable  keyboard traversal for a toplevel window containing a note‐
202       book widget $nb, call:
203              ttk::notebook::enableTraversal $nb
204
205       This will extend the bindings for the toplevel  window  containing  the
206       notebook as follows:
207
208       ·      Control-Tab  selects  the  tab  following the currently selected
209              one.
210
211       ·      Control-Shift-Tab  selects  the  tab  preceding  the   currently
212              selected one.
213
214       ·      Alt-K,  where  K  is  the mnemonic (underlined) character of any
215              tab, will select that tab.
216
217       Multiple notebooks in a single toplevel may be enabled  for  traversal,
218       including  nested  notebooks.   However,  notebook traversal only works
219       properly if all panes are direct children of the notebook.
220

VIRTUAL EVENTS

222       The notebook widget generates a  <<NotebookTabChanged>>  virtual  event
223       after a new tab is selected.
224

EXAMPLE

226              pack [ttk::notebook .nb]
227              .nb add [frame .nb.f1] -text "First tab"
228              .nb add [frame .nb.f2] -text "Second tab"
229              .nb select .nb.f2
230              ttk::notebook::enableTraversal .nb
231

SEE ALSO

233       ttk::widget(n), grid(n)
234

KEYWORDS

236       pane, tab
237
238
239
240Tk                                    8.5                     ttk::notebook(n)
Impressum