1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
|
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>Tile package reference: notebook</title><meta name="xsl-processor" content="Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile: tmml-html.xsl,v $ $Revision: 1.12 $">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid8206658">NAME</a> <a href="#SECTid82066d0">SYNOPSIS</a> <a href="#SECTid8206900">DESCRIPTION</a> <a href="#SECTid82069c8">STANDARD OPTIONS</a> <a href="#SECTid8206ae0">WIDGET OPTIONS</a> <a href="#SECTid8206ec8">TAB OPTIONS</a> <a href="#SECTid8207710">WIDGET COMMAND</a> <a href="#SECTid8208750">KEYBOARD TRAVERSAL</a> <a href="#SECTid82089a8">TAB IDENTIFIERS</a> <a href="#SECTid8208c28">VIRTUAL EVENTS</a> <a href="#SECTid8208cc8">EXAMPLE</a> <a href="#SECTid8208d40">SEE ALSO</a> <a href="#SECTid8208db8">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
<h2><a name="SECTid8206658">NAME</a></h2><p class="namesection">
<b class="names">ttk::notebook - </b><br>Multi-paned container widget</p>
<h2><a name="SECTid82066d0">SYNOPSIS</a></h2><pre class="syntax">
<b>ttk::notebook</b> <i class="m">pathName</i> ?<i class="m">options...</i>?
<i class="m">pathName</i> <b>add</b> <i class="m">window</i> ?<i class="m">options...</i>?
<i class="m">pathName</i> <b>insert</b> <i class="m">index</i> <i class="m">window</i> ?<i class="m">options...</i>?
</pre>
<h2><a name="SECTid8206900">DESCRIPTION</a></h2><p>A <b>ttk::notebook</b> widget manages a collection of windows
and displays a single one at a time.
Each slave window is associated with a <i>tab</i>,
which the user may select to change the currently-displayed window.
</p>
<h2><a name="SECTid82069c8">STANDARD OPTIONS</a></h2><div class="menu"><table class="menu" width="100%"><tr>
<td width="25%"><a href="widget.html#stdopt_-class">-class</a></td><td width="25%"><a href="widget.html#stdopt_-cursor">-cursor</a></td><td width="25%"><a href="widget.html#stdopt_-style">-style</a></td><td width="25%"><a href="widget.html#stdopt_-takefocus">-takefocus</a></td>
</tr></table></div>
<h2><a name="SECTid8206ae0">WIDGET OPTIONS</a></h2><div class="table"><table width="100%" rules="none" cellpadding="5%">
<thead><tr class="heading">
<th width="20%">Name</th><th width="40%">Database name</th><th width="40%">Database class</th>
</tr></thead><tr class="syntax">
<td width="20%" align="left"><a name="option_-height">-height</a></td><td width="40%" align="left">height</td><td width="40%" align="left">Height</td>
</tr><tr class="desc">
<td class="padding" width="20%"></td><td class="argdesc" width="80%" align="left" colspan="2">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.
</td>
</tr><tr class="syntax">
<td width="20%" align="left"><a name="option_-padding">-padding</a></td><td width="40%" align="left">padding</td><td width="40%" align="left">Padding</td>
</tr><tr class="desc">
<td class="padding" width="20%"></td><td class="argdesc" width="80%" align="left" colspan="2">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
<i>left top right bottom</i>.
If fewer than four elements are specified,
<i>bottom</i> defaults to <i>top</i>,
<i>right</i> defaults to <i>left</i>, and
<i>top</i> defaults to <i>left</i>.
</td>
</tr><tr class="syntax">
<td width="20%" align="left"><a name="option_-width">-width</a></td><td width="40%" align="left">width</td><td width="40%" align="left">Width</td>
</tr><tr class="desc">
<td class="padding" width="20%"></td><td class="argdesc" width="80%" align="left" colspan="2">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.
</td>
</tr>
</table></div>
<h2><a name="SECTid8206ec8">TAB OPTIONS</a></h2><p>The following options may be specified for individual notebook panes:
</p><div class="table"><table width="100%" rules="none" cellpadding="5%">
<thead><tr class="heading">
<th width="20%">Name</th><th width="40%">Database name</th><th width="40%">Database class</th>
</tr></thead><tr class="syntax">
<td width="20%" align="left"><a name="option_-state">-state</a></td><td width="40%" align="left">state</td><td width="40%" align="left">State</td>
</tr><tr class="desc">
<td class="padding" width="20%"></td><td class="argdesc" width="80%" align="left" colspan="2">Either <b>normal</b>, <b>disabled</b> or <b>hidden</b>.
If <b>disabled</b>, then the tab is not selectable.
If <b>hidden</b>, then the tab is not shown.
</td>
</tr><tr class="syntax">
<td width="20%" align="left"><a name="option_-sticky">-sticky</a></td><td width="40%" align="left">sticky</td><td width="40%" align="left">Sticky</td>
</tr><tr class="desc">
<td class="padding" width="20%"></td><td class="argdesc" width="80%" align="left" colspan="2">Specifies how the slave window is positioned within the pane area.
Value is a string containing zero or more of the characters
<b>n, s, e,</b> or <b>w</b>.
Each letter refers to a side (north, south, east, or west)
that the slave window will "stick" to,
as per the <b class="cmd">grid</b> geometry manager.
</td>
</tr><tr class="syntax">
<td width="20%" align="left"><a name="option_-padding">-padding</a></td><td width="40%" align="left">padding</td><td width="40%" align="left">Padding</td>
</tr><tr class="desc">
<td class="padding" width="20%"></td><td class="argdesc" width="80%" align="left" colspan="2">Specifies the amount of extra space to add between the notebook and this pane.
Syntax is the same as for the widget <b>-padding</b> option.
</td>
</tr><tr class="syntax">
<td width="20%" align="left"><a name="option_-text">-text</a></td><td width="40%" align="left">text</td><td width="40%" align="left">Text</td>
</tr><tr class="desc">
<td class="padding" width="20%"></td><td class="argdesc" width="80%" align="left" colspan="2">Specifies a string to be displayed in the tab.
</td>
</tr><tr class="syntax">
<td width="20%" align="left"><a name="option_-image">-image</a></td><td width="40%" align="left">image</td><td width="40%" align="left">Image</td>
</tr><tr class="desc">
<td class="padding" width="20%"></td><td class="argdesc" width="80%" align="left" colspan="2">Specifies an image to display in the tab.
See <i>widget(n)</i> for details.
</td>
</tr><tr class="syntax">
<td width="20%" align="left"><a name="option_-compound">-compound</a></td><td width="40%" align="left">compound</td><td width="40%" align="left">Compound</td>
</tr><tr class="desc">
<td class="padding" width="20%"></td><td class="argdesc" width="80%" align="left" colspan="2">Specifies how to display the image relative to the text,
in the case both <b>-text</b> and <b>-image</b> are present.
See <i>label(n)</i> for legal values.
</td>
</tr><tr class="syntax">
<td width="20%" align="left"><a name="option_-underline">-underline</a></td><td width="40%" align="left">underline</td><td width="40%" align="left">Underline</td>
</tr><tr class="desc">
<td class="padding" width="20%"></td><td class="argdesc" width="80%" align="left" colspan="2">Specifies the integer index (0-based) of a character to underline
in the text string.
The underlined character is used for mnemonic activation
if <b>ttk::notebook::enableTraversal</b> is called.
</td>
</tr>
</table></div>
<h2><a name="SECTid8207710">WIDGET COMMAND</a></h2><dl class="commandlist">
<dt>
<i class="m">pathname</i> <b>add</b> <i class="m">window</i> ?<i class="m">options...</i>?</dt>
<dd>Adds a new tab to the notebook.
See <a href="#SECTid8206ec8">TAB OPTIONS</a> for the list of available <i>options</i>.
If <i>window</i> is currently managed by the notebook but hidden,
it is restored to its previous position.
</dd>
<dt>
<i class="m">pathname</i> <b>configure</b> ?<i class="m">options</i>?</dt>
<dd>See <i>widget(n)</i>.
</dd>
<dt>
<i class="m">pathname</i> <b>cget</b> <i class="m">option</i>
</dt>
<dd>See <i>widget(n)</i>.
</dd>
<dt>
<i class="m">pathname</i> <b>forget</b> <i class="m">tabid</i>
</dt>
<dd>Removes the tab specified by <i>tabid</i>,
unmaps and unmanages the associated window.
</dd>
<dt>
<i class="m">pathname</i> <b>hide</b> <i class="m">tabid</i>
</dt>
<dd>Hides the tab specified by <i>tabid</i>.
The tab will not be displayed, but the associated window
remains managed by the notebook and its configuration remembered.
Hidden tabs may be restored with the <b>add</b> command.
</dd>
<dt>
<i class="m">pathname</i> <b>index</b> <i class="m">tabid</i>
</dt>
<dd>Returns the numeric index of the tab specified by <i>tabid</i>,
or the total number of tabs if <i>tabid</i> is the string "<b>end</b>".
</dd>
<dt>
<i class="m">pathname</i> <b>insert</b> <i class="m">pos</i> <i class="m">subwindow</i> <i class="m">options...</i>
</dt>
<dd>Inserts a pane at the specified position.
<i>pos</i> is either the string <b>end</b>, an integer index,
or the name of a managed subwindow.
If <i>subwindow</i> is already managed by the notebook,
moves it to the specified position.
See <a href="#SECTid8206ec8">TAB OPTIONS</a> for the list of available options.
</dd>
<dt>
<i class="m">pathname</i> <b>instate</b> <i class="m">statespec</i> ?<i class="m">script...</i>?</dt>
<dd>See <i>widget(n)</i>.
</dd>
<dt>
<i class="m">pathname</i> <b>select</b> ?<i class="m">tabid</i>?</dt>
<dd>Selects the specified tab.
The associated slave window will be displayed,
and the previously-selected window (if different) is unmapped.
If <i>tabid</i> is omitted, returns the widget name of the
currently selected pane.
</dd>
<dt>
<i class="m">pathname</i> <b>state</b> ?<i class="m">statespec</i>?</dt>
<dd>See <i>widget(n)</i>.
</dd>
<dt>
<i class="m">pathname</i> <b>tab</b> <i class="m">tabid</i> ?<i class="m">-option</i> ?<i class="m">value ...</i>
</dt>
<dd>Query or modify the options of the specific tab.
If no <i>-option</i> is specified,
returns a dictionary of the tab option values.
If one <i>-option</i> is specified,
returns the value of that <i>option</i>.
Otherwise, sets the <i>-option</i>s to the corresponding <i>value</i>s.
See <a href="#SECTid8206ec8">TAB OPTIONS</a> for the available options.
</dd>
<dt>
<i class="m">pathname</i> <b>tabs</b>
</dt>
<dd>Returns the list of windows managed by the notebook.
</dd>
</dl>
<h2><a name="SECTid8208750">KEYBOARD TRAVERSAL</a></h2><p>To enable keyboard traversal for a toplevel window
containing a notebook widget <i>$nb</i>, call:
</p><pre class="example">
ttk::notebook::enableTraversal $nb
</pre><p>This will extend the bindings for the toplevel window
containing the notebook as follows:
</p><ul>
<li>
<b>Control-Tab</b> selects the tab following the currently selected one.
</li>
<li>
<b>Shift-Control-Tab</b> selects the tab preceding the currently selected one.
</li>
<li>
<b>Alt-K</b>, where <b>K</b> is the mnemonic (underlined) character
of any tab, will select that tab.
</li>
</ul><p>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.
</p>
<h2><a name="SECTid82089a8">TAB IDENTIFIERS</a></h2><p>The <i>tabid</i> argument to the above commands may take
any of the following forms:
</p><ul>
<li>An integer between zero and the number of tabs;
</li>
<li>The name of a slave window;
</li>
<li>A positional specification of the form "@<i>x</i>,<i>y</i>",
which identifies the tab
</li>
<li>The literal string "<b>current</b>",
which identifies the currently-selected tab; or:
</li>
<li>The literal string "<b>end</b>",
which returns the number of tabs
(only valid for "<i>pathname</i> <b>index</b>").
</li>
</ul>
<h2><a name="SECTid8208c28">VIRTUAL EVENTS</a></h2><p>The notebook widget generates a <b><<NotebookTabChanged>></b>
virtual event after a new tab is selected.
</p>
<h2><a name="SECTid8208cc8">EXAMPLE</a></h2><pre class="example">
notebook .nb
.nb add [frame .nb.f1] -text "First tab"
.nb add [frame .nb.f2] -text "Second tab"
.nb select .nb.f2
ttk::notebook::enableTraversal .nb
</pre>
<h2><a name="SECTid8208d40">SEE ALSO</a></h2><p class="seealso">widget(n), grid(n)</p>
<h2><a name="SECTid8208db8">KEYWORDS</a></h2><p class="keywords">
<a class="keyword" href="keyword-index.html#KW-pane">pane</a>, <a class="keyword" href="keyword-index.html#KW-tab">tab</a>
</p>
</div><hr class="navsep"><div class="navbar" align="center">
<a class="navaid" href="index.html">Contents</a> <a class="navaid" href="category-index.html">Index</a> <a class="navaid" href="keyword-index.html">Keywords</a>
</div>
</body>
</html>
|