The iwidgets::notebookfRcommandcreatesanewTclcommandwhosenameispathName. This command may be
used to invoke various operations on the widget. It has the following general form: pathNameoption ?argarg...? option and the args determine the exact behavior of the command.
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:
number 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. number Specifies the page
numerically, where 0 corresponds to the first page in the notebook, 1 to the second, and so on.
select Specifies the currently selected page's index. If no page is currently selected, the value -1 is
returned.
end Specifes the last page in the notebooks's index. If the notebook is empty this will return -1.
pattern
If the index doesn't satisfy the form of a number, then this form is used. Pattern is pattern-
matched against the label of each page in the notebook, in order from the first to the last page,
until a matching entry is found. The rules of Tcl_StringMatch are used.
............................................................
The following commands are possible for notebook widgets:
pathNameadd ?optionvalue?
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:
-backgroundvalue
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.
-commandvalue
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.
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.
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.
-foregroundvalue
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.
-labelvalue
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.
pathNamechildSite ?index?
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
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.
pathNamecgetoption
Returns the current value of the configuration option given by option.
pathNameconfigure ?option? ?valueoptionvalue ...?
Query or modify the configuration options of the widget. If no option is specified, returns a list
describing all of the available options for pathName (see Tk_ConfigureInfo for information on the
format of this list). If option is specified with no value, 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. Option may have any of the values accepted by the
iwidgets::notebook command.
pathNamedeleteindex1 ?index2?
Delete all of the pages between index1 and index2 inclusive. If index2 is omitted then it
defaults to index1. Returns an empty string.
pathNameindexindex
Returns the numerical index corresponding to index.
pathNameinsertindex ?optionvalue?
Insert a new page in the notebook before the page specified by index. A new child site frame is
created. See the add command for valid options. Returns the child site pathName.
pathNamenext
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.
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.
For notebooks with auto set to false the Tcl command given with the command option will be
invoked.
pathNamepagecgetindex ?option?
Returns the current value of the configuration option given by option for the page specified by
index. The valid available options are the same as available to the add command.
pathNamepageconfigureindex ?option? ?valueoptionvalue ...?
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 index (see Tk_ConfigureInfo for information
on the format of this list).
pathNameprev
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.
For notebooks with auto set to true 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.
For notebooks with auto set to false the Tcl command given with the command option will be
invoked.
pathNameselectindex
Selects the page specified by index as the currently selected page.
For notebooks with auto set to true 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.
For notebooks with auto set to false the Tcl command given with the command option will be
invoked.
pathNameview
Returns the currently selected page. This command is for compatibility with the scrollbar widget.
pathNameviewindex
Selects the page specified by index as the currently selected page. This command is for
compatibility with the scrollbar widget.
pathNameviewmovetofraction
Uses the fraction value to determine the corresponding page to move to. This command is for
compatibility with the scrollbar widget.
pathNameviewscrollnumwhat
Uses the num value to determine how many pages to move forward or backward (num can be negative or
positive). The what argument is ignored. This command is for compatibility with the scrollbar
widget.