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 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438
|
<!-- manual page source format generated by RosettaMan v2.5a6, -->
<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
<HTML>
<HEAD>
<TITLE>man page(1) manual page</TITLE>
</HEAD>
<BODY>
<A HREF="#toc">Table of Contents</A><P>
_________________________________________________________________
<P>
<H2><A NAME="sect1" HREF="#toc1"><B>NAME</B></A></H2>
notebook - create and manipulate notebook widgets
<P>
<H2><A NAME="sect2" HREF="#toc2"><B>SYNOPSIS</B></A></H2>
<B>notebook</B> <I>pathName</I> ?<I>options</I>?
<P>
<H2><A NAME="sect3" HREF="#toc3"><B>INHERITANCE</B></A></H2>
itk::Widget <- notebook
<P>
<H2><A NAME="sect4" HREF="#toc4"><B>STANDARD</B> <B>OPTIONS</B></A></H2>
<DL>
<DT><B>background</B> <DD> <B>foreground</B> <B>scrollCommand</B> <B>width</B>
</DD>
</DL>
<DL>
<DT><B>cursor</B> <DD> <B>height</B>
<P>
</DD>
</DL>
See the "options" manual entry for details on the standard
options.
<P>
<H2><A NAME="sect5" HREF="#toc5"><B>WIDGET-SPECIFIC</B> <B>OPTIONS</B></A></H2>
<DL>
<DT>Name: <DD> <B>auto</B>
</DD>
</DL>
<DL>
<DT>Class: <DD> <B>Auto</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD> <B>-auto</B>
<P>
</DD>
</DL>
Specifies whether to use the automatic
packing/unpacking algorithm of the notebook. A value of
<B>true</B> indicates that page frames will be unpacked and
packed acoording to the algorithm described in the
<B>select</B> command. A value of <B>false</B> leaves the current
page packed and subsequent selects, next, or previous
commands do not switch pages automatically. In either
case the page's associated command (see the <B>add</B>
command's description of the <B>command</B> option) is
invoked. The value may have any of the forms accepted
by the <B>Tcl_GetBoolean</B>, such as true, false, 0, 1, yes,
or no.
<P>
For example, if a series of pages in a notebook simply
change certain display configurations of a graphical
display, the <B>-auto</B> flag could be used. By setting it,
the <B>-command</B> procs could do the appropriate reconfiguring
of the page when the page is switched.
_________________________________________________________________
<P>
<H2><A NAME="sect6" HREF="#toc6"><B>DESCRIPTION</B></A></H2>
The <B>notebook</B> command creates a new window (given by the
pathName argument) and makes it into a notebook widget.
Additional options, described above may be specified on the
command line or in the option database to configure aspects
of the notebook such as its colors, font, and text. The
<B>notebook</B> command returns its <I>pathName</I> argument. At the time
this command is invoked, there must not exist a window named
pathName, but pathName's parent must exist.
<P>
A notebook is a widget that contains a set of pages. It
displays one page from the set as the selected page. When a
page is selected, the page's contents are displayed in the
page area. When first created a notebook has no pages. Pages
may be added or deleted using widget commands described
below.
<P>
<H2><A NAME="sect7" HREF="#toc7"><B>NOTEBOOK</B> <B>PAGES</B></A></H2>
A notebook's pages area contains a single child site <B>frame</B>.
When a new page is created it is a child of this frame. The
page's child site frame serves as a geometry container for
applications to pack widgets into. It is this frame that is
automatically unpacked or packed when the <B>auto</B> option is
<B>true</B>. This creates the effect of one page being visible at a
time. When a new page is selected, the previously selected
page's child site frame is automatically unpacked from the
notebook's child site frame and the newly selected page's
child site is packed into the notebook's child site frame.
<P>
However, sometimes it is desirable to handle page changes in
a different manner. By specifying the <B>auto</B> option as <B>false</B>,
child site packing can be disabled and done differently. For
example, all widgets might be packed into the first page's
child site frame. Then when a new page is selected, the
application can reconfigure the widgets and give the appearance
that the page was flipped.
<P>
In both cases the <B>command</B> option for a page specifies a Tcl
Command to execute when the page is selected. In the case of
<B>auto</B> being <B>true</B>, it is called between the unpacking of the
previously selected page and the packing of the newly
selected page.
<P>
<H2><A NAME="sect8" HREF="#toc8"><B>WIDGET-SPECIFIC</B> <B>METHODS</B></A></H2>
The <B>notebookfR</B> <B>command</B> <B>creates</B> <B>a</B> <B>new</B> <B>Tcl</B> <B>command</B> <B>whose</B> <B>name</B>
<B>is</B> <I>pathName</I>. This command may be used to invoke various
operations on the widget. It has the following general form:
<P>
<I>pathName</I> <I>option</I> ?<I>arg</I> <I>arg</I> ...?
<P>
<I>option</I> and the <I>arg</I>s determine the exact behavior of the command.
<P>
Many of the widget commands for a notebook take as one argument
an indicator of which page of the notebook to operate
on. These indicators are called indexes and may be specified
in any of the following forms:
<P>
<I>number</I><BR>
Specifies the index of the the component. For menus, 0
corresponds to the left-most menu of the menu bar. For
entries, 0 corresponds to the top-most entry of the
menu. <I>number</I> Specifies the page numerically, where 0
corresponds to the first page in the notebook, 1 to the
second, and so on.
<P>
<B>select</B><BR>
Specifies the currently selected page's index. If no
page is currently selected, the value -1 is returned.
<P>
<B>end</B> Specifes the last page in the notebooks's index. If the
notebook is empty this will return -1.
<P>
<I>pattern</I><BR>
If the index doesn't satisfy the form of a number, then
this form is used. Pattern is pattern-matched against
the <B>label</B> of each page in the notebook, in order from
the first to the last page, until a matching entry is
found. The rules of <B>Tcl_StringMatch</B> are used.
<P>
The following commands are possible for notebook widgets:
<P>
<I>pathName</I> <B>add</B> ?<I>option</I> <I>value</I>?<BR>
Add a new page at the end of the notebook. A new child
site frame is created. Returns the child site pathName.
If additional arguments are present, they specify any
of the following options:
<P>
<DL>
<DT><B>-background</B> <I>value</I><DD>
Specifies a background color to use for displaying
the child site frame of this page. If this option
is specified as an empty string (the default),
then the background option for the overall notebook
is used.
<P>
</DD>
</DL>
<DL>
<DT><B>-command</B> <I>value</I><DD>
Specifies a Tcl command to be executed when this
page is selected. This allows the programmer a
hook to reconfigure this page's widgets or any
other page's widgets.
<P>
</DD>
</DL>
If the notebook has the auto option set to true,
when a page is selected this command will be
called immediately after the previously selected
page is unpacked and immediately before this page
is selected. The index value select is valid during
this Tcl command. `index select' will return
this page's page number.
<P>
If the auto option is set to false, when a page is
selected the unpack and pack calls are bypassed.
This Tcl command is still called.
<P>
<DL>
<DT><B>-foreground</B> <I>value</I><DD>
Specifies a foreground color to use for displaying
tab labels when tabs are in their normal
unselected state. If this option is specified as
an empty string (the default), then the foreground
option for the overall notebook is used.
<P>
</DD>
</DL>
<DL>
<DT><B>-label</B> <I>value</I><DD>
Specifies a string to associate with this page.
This label serves as an additional identifier used
to reference the page. This label may be used for
the index value in widget commands.
<P>
</DD>
</DL>
<I>pathName</I> <B>childSite</B> ?<I>index</I>?<BR>
If passed no arguments, returns a list of pathNames for
all the pages in the notebook. If the notebook is
empty, an empty list is returned
<P>
If index is passed, it returns the pathName for the
page's child site frame specified by index. Widgets
that are created with this pathName will be displayed
when the associated page is selected. If index is not a
valid index, an empty string is returned.
<P>
<I>pathName</I> <B>cget</B> <I>option</I><BR>
Returns the current value of the configuration option
given by <I>option</I>.
<P>
<I>pathName</I> <B>configure</B> ?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?
Query or modify the configuration options of the
widget. If no <I>option</I> is specified, returns a list
describing all of the available options for <I>pathName</I>
(see <B>Tk_ConfigureInfo</B> for information on the format of
this list). If <I>option</I> is specified with no <I>value</I>, then
the command returns a list describing the one named
option (this list will be identical to the corresponding
sublist of the value returned if no option is
specified). If one or more option-value pairs are
specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the
command returns an empty string. <I>Option</I> may have any of
the values accepted by the <B>notebook</B> command.
<P>
<I>pathName</I> <B>delete</B> <I>index1</I> ?index2?<BR>
Delete all of the pages between <I>index1</I> and <I>index2</I>
inclusive. If <I>index2</I> is omitted then it defaults to
<I>index1</I>. Returns an empty string.
<P>
<I>pathName</I> <B>index</B> <I>index</I><BR>
Returns the numerical index corresponding to <I>index</I>.
<P>
<B>pathName</B> <B>insert</B> <I>index</I> ?<I>option</I> <I>value</I>?
<P>
Insert a new page in the notebook before the page
specified by <I>index</I>. A new child site <B>frame</B> is created.
See the <B>add</B> command for valid options. Returns the
child site pathName.
<P>
<I>pathName</I> <B>next</B><BR>
Advances the selected page to the next page (order is
determined by insertion order). If the currently
selected page is the last page in the notebook, the
selection wraps around to the first page in the notebook.
<P>
For notebooks with auto set to true the current page's
child site is unpacked from the notebook's child site
frame. Then the next page's child site is packed into
the notebooks child site frame. The Tcl command given
with the command option will be invoked between these
two operations.
<P>
For notebooks with auto set to false the Tcl command
given with the command option will be invoked.
<P>
<I>pathName</I> <B>pagecget</B> <I>index</I> ?<I>option</I>?<BR>
Returns the current value of the configuration option
given by <I>option</I> for the page specified by <I>index</I>. The
valid available options are the same as available to
the <B>add</B> command.
<P>
<I>pathName</I> <B>pageconfigure</B> <I>index</I> ?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?
This command is similar to the configure command,
except that it applies to the options for an individual
page, whereas configure applies to the options for the
notebook. Options may have any of the values accepted
by the add widget command. If options are specified,
options are modified as indicated in the command and
the command returns an empty string. If no options are
specified, returns a list describing the current
options for page <I>index</I> (see <B>Tk_ConfigureInfo</B> for information
on the format of this list).
<P>
<I>pathName</I> <B>prev</B><BR>
Moves the selected page to the previous page (order is
determined by insertion order). If the currently
selected page is the first page in the notebook, the
selection wraps around to the last page in the notebook.
<P>
For notebooks with <B>auto</B> set to <B>true</B> the current page's
child site is unpacked from the notebook's child site
frame. Then the previous page's child site is packed
into the notebooks child site frame. The Tcl command
given with the command option will be invoked between
these two operations.
<P>
For notebooks with <B>auto</B> set to <B>false</B> the Tcl command
given with the command option will be invoked.
<P>
<I>pathName</I> <B>select</B> <I>index</I><BR>
Selects the page specified by <I>index</I> as the currently
selected page.
<P>
For notebooks with <B>auto</B> set to <B>true</B> the current page's
child site is unpacked from the notebook's child site
frame. Then the index page's child site is packed into
the notebooks child site frame. The Tcl command given
with the command option will be invoked between these
two operations.
<P>
For notebooks with <B>auto</B> set to <B>false</B> the Tcl command
given with the command option will be invoked.
<P>
<I>pathName</I> <B>view</B><BR>
Returns the currently selected page. This command is
for compatibility with the scrollbar widget.
<P>
<I>pathName</I> <B>view</B> <I>index</I><BR>
Selects the page specified by <I>index</I> as the currently
selected page. This command is for compatibility with
the scrollbar widget.
<P>
<I>pathName</I> <B>view</B> <I>moveto</I> <I>fraction</I><BR>
Uses the fraction value to determine the corresponding
page to move to. This command is for compatibility with
the scrollbar widget.
<P>
<I>pathName</I> <B>view</B> <I>scroll</I> <I>num</I> <I>what</I><BR>
Uses the <I>num</I> value to determine how many pages to move
forward or backward (num can be negative or positive).
The <I>what</I> argument is ignored. This command is for compatibility
with the scrollbar widget.
<P>
<H2><A NAME="sect9" HREF="#toc9"><B>EXAMPLE</B></A></H2>
Following is an example that creates a notebook with two
pages. In this example, we use a scrollbar widget to control
the notebook widget.
<P>
# Create the notebook widget and pack it.
notebook .nb -width 100 -height 100
pack .nb -anchor nw \<BR>
-fill both \<BR>
-expand yes \<BR>
-side left \<BR>
-padx 10 \
-pady 10
<P>
# Add two pages to the notebook, labelled
# "Page One" and "Page Two", respectively.
.nb add -label "Page One"<BR>
.nb add -label "Page Two"
<P>
# Get the child site frames of these two pages.
set page1CS [.nb childsite 0]<BR>
set page2CS [.nb childsite "Page Two"]
<P>
# Create buttons on each page of the notebook
button $page1CS.b -text "Button One"
pack $page1CS.b<BR>
button $page2CS.b -text "Button Two"
pack $page2CS.b
<P>
# Select the first page of the notebook
.nb select 0
<P>
# Create the scrollbar and associate teh scrollbar
# and the notebook together, then pack the scrollbar
ScrollBar .scroll -command ".nb view"
.nb configure -scrollcommand ".scroll set"
pack .scroll -fill y -expand yes -pady 10
<P>
<H2><A NAME="sect10" HREF="#toc10"><B>AUTHOR</B></A></H2>
Bill W. Scott
<P>
<H2><A NAME="sect11" HREF="#toc11"><B>KEYWORDS</B></A></H2>
notebook page
<P>
<HR><P>
<A NAME="toc"><B>Table of Contents</B></A><P>
<UL>
<LI><A NAME="toc1" HREF="#sect1">NAME</A></LI>
<LI><A NAME="toc2" HREF="#sect2">SYNOPSIS</A></LI>
<LI><A NAME="toc3" HREF="#sect3">INHERITANCE</A></LI>
<LI><A NAME="toc4" HREF="#sect4">STANDARD OPTIONS</A></LI>
<LI><A NAME="toc5" HREF="#sect5">WIDGET-SPECIFIC OPTIONS</A></LI>
<LI><A NAME="toc6" HREF="#sect6">DESCRIPTION</A></LI>
<LI><A NAME="toc7" HREF="#sect7">NOTEBOOK PAGES</A></LI>
<LI><A NAME="toc8" HREF="#sect8">WIDGET-SPECIFIC METHODS</A></LI>
<LI><A NAME="toc9" HREF="#sect9">EXAMPLE</A></LI>
<LI><A NAME="toc10" HREF="#sect10">AUTHOR</A></LI>
<LI><A NAME="toc11" HREF="#sect11">KEYWORDS</A></LI>
</UL>
</BODY></HTML>
|