diff options
Diffstat (limited to 'itcl/iwidgets3.0.0/demos/html/tabset.n.html')
-rw-r--r-- | itcl/iwidgets3.0.0/demos/html/tabset.n.html | 1240 |
1 files changed, 681 insertions, 559 deletions
diff --git a/itcl/iwidgets3.0.0/demos/html/tabset.n.html b/itcl/iwidgets3.0.0/demos/html/tabset.n.html index 2ecaf36745a..90e6f7b856c 100644 --- a/itcl/iwidgets3.0.0/demos/html/tabset.n.html +++ b/itcl/iwidgets3.0.0/demos/html/tabset.n.html @@ -1,559 +1,681 @@ -<HTML> -<HEAD> -<TITLE>iwidgets2.2.0 User Commands - tabset</TITLE> -</HEAD> -<BODY BGCOLOR="#FFFFFF"> -<H1>iwidgets2.2.0 User Commands - tabset</H1> -<HR> -<PRE> - -</PRE> -<H2><HR ALIGN=LEFT WIDTH=70% SIZE=3></H2><PRE> - - -</PRE> -<H2>NAME</H2><PRE> - tabset - create and manipulate tabs as as set - - -</PRE> -<H2>SYNOPSIS</H2><PRE> - <STRONG>tabset</STRONG> <EM>pathName</EM> ?<EM>options</EM>? - - -</PRE> -<H2>INHERITANCE</H2><PRE> - itk::Widget <- tabset - - -</PRE> -<H2>STANDARD OPTIONS</H2><PRE> - <STRONG>background</STRONG> <STRONG>font</STRONG> <STRONG>selectBackgroundcursor</STRONG> - <STRONG>foreground</STRONG> <STRONG>selectForeground</STRONG> <STRONG>disabledForegroundheight</STRONG> - <STRONG>width</STRONG> - - See the "options" manual entry for details on the standard - options. - - -</PRE> -<H2>WIDGET-SPECIFIC OPTIONS</H2><PRE> - Name: <STRONG>angle</STRONG> - Class: <STRONG>Angle</STRONG> - Command-Line Switch: <STRONG>-angle</STRONG> - - Specifes the angle of slope from the inner edge to the - outer edge of the tab. An angle of 0 specifies square - tabs. Valid ranges are 0 to 45 degrees inclusive. - Default is 15 degrees. If tabPos is e or w, this option - is ignored. - - Name: <STRONG>backdrop</STRONG> - Class: <STRONG>Backdrop</STRONG> - Command-Line Switch: <STRONG>-backdrop</STRONG> - - Specifies a background color to use when filling in the - area behind the tabs. - - Name: <STRONG>bevelAmount</STRONG> - Class: <STRONG>BevelAmount</STRONG> - Command-Line Switch: <STRONG>-bevelamount</STRONG> - - Specifes the size of tab corners. A value of 0 with - angle set to 0 results in square tabs. A <STRONG>bevelAmount</STRONG> of - 4, means that the tab will be drawn with angled corners - that cut in 4 pixels from the edge of the tab. The - default is 0. - - Name: <STRONG>command</STRONG> - Class: <STRONG>Command</STRONG> - Command-Line Switch: <STRONG>-command</STRONG> - Specifes the prefix of a Tcl command to invoke to change the view in the - widget associated with the tabset. When a user selects a tab, a Tcl command - is invoked. The actual command consists of this option followed by a space - and a number. The number is the numerical index of the tab that has been - selected. - - Name: <STRONG>equalTabs</STRONG> - Class: <STRONG>EqualTabs</STRONG> - Command-Line Switch: <STRONG>-equaltabs</STRONG> - - Specifies whether to force tabs to be equal sized or - not. A value of <STRONG>true</STRONG> means constrain tabs to be equal - sized. A value of <STRONG>false</STRONG> allows each tab to size based - on the text label size. The value may have any of the - forms accepted by the <STRONG>Tcl_GetBoolean</STRONG>, such as <STRONG>true</STRONG>, - <STRONG>false</STRONG>, <STRONG>0</STRONG>, <STRONG>1</STRONG>, <STRONG>yes</STRONG>, or <STRONG>no</STRONG>. - - For horizontally positioned tabs (<STRONG>tabPos</STRONG> is either <STRONG>s</STRONG> or - <STRONG>n</STRONG>), <STRONG>true</STRONG> forces all tabs to be equal width (the width - being equal to the longest label plus any padX speci- - fied). Horizontal tabs are always equal in height. - - For vertically positioned tabs (<STRONG>tabPos</STRONG> is either <STRONG>w</STRONG> or - <STRONG>e</STRONG>), <STRONG>true</STRONG> forces all tabs to be equal height (the height - being equal to the height of the label with the largest - font). Vertically oriented tabs are always equal in - width. - - Name: <STRONG>gap</STRONG> - Class: <STRONG>Gap</STRONG> - Command-Line Switch: <STRONG>-gap</STRONG> - - Specifies the amount of pixel space to place between - each tab. Value may be any pixel offset value. In addi- - tion, a special keyword <STRONG>overlap</STRONG> can be used as the - value to achieve a standard overlap of tabs. This value - may have any of the forms acceptable to <STRONG>Tk_GetPixels</STRONG>. - - Name: <STRONG>margin</STRONG> - Class: <STRONG>Margin</STRONG> - Command-Line Switch: <STRONG>-margin</STRONG> - - Specifies the amount of space to place between the out- - side edge of the tabset and the outside edge of its - tabs. If <STRONG>tabPos</STRONG> is <STRONG>s</STRONG>, this is the amount of space - between the bottom edge of the tabset and the bottom - edge of the set of tabs. If <STRONG>tabPos</STRONG> is <STRONG>n</STRONG>, this is the - amount of space between the top edge of the tabset and - the top edge of the set of tabs. If <STRONG>tabPos</STRONG> is <STRONG>e</STRONG>, this - is the amount of space between the right edge of the - tabset and the right edge of the set of tabs. If <STRONG>tabPos</STRONG> - is <STRONG>w</STRONG>, this is the amount of space between the left edge - of the tabset and the left edge of the set of tabs. - This value may have any of the forms acceptable to - <STRONG>Tk_GetPixels</STRONG>. - - Name: <STRONG>padX</STRONG> - Class: <STRONG>PadX</STRONG> - Command-Line Switch: <STRONG>-padx</STRONG> - - Specifies a non-negative value indicating how much - extra space to request for a tab around its label in - the X-direction. When computing how large a window it - needs, the tab will add this amount to the width it - would normally need The tab will end up with extra - internal space to the left and right of its text label. - This value may have any of the forms acceptable to - <STRONG>Tk_GetPixels</STRONG>. - - Name: <STRONG>padY</STRONG> - Class: <STRONG>PadY</STRONG> - Command-Line Switch: <STRONG>-pady</STRONG> - - Specifies a non-negative value indicating how much - extra space to request for a tab around its label in - the Y-direction. When computing how large a window it - needs, the tab will add this amount to the height it - would normally need The tab will end up with extra - internal space to the top and bottom of its text label. - This value may have any of the forms acceptable to - <STRONG>Tk_GetPixels</STRONG>. - - Name: <STRONG>raiseSelect</STRONG> - Class: <STRONG>RaiseSelect</STRONG> - Command-Line Switch: <STRONG>-raiseselect</STRONG> - - Specifes whether to slightly raise the selected tab - from the rest of the tabs. The selected tab is drawn 2 - pixels closer to the outside edge of the tabset than - the unselected tabs. A value of true says to raise - selected tabs, a value of false turns this off. The - default is false. The value may have any of the forms - accepted by the <STRONG>Tcl_GetBoolean</STRONG>, such as <STRONG>true</STRONG>, <STRONG>false</STRONG>, <STRONG>0</STRONG>, - <STRONG>1</STRONG>, <STRONG>yes</STRONG>, or <STRONG>no</STRONG>. - - Name: <STRONG>start</STRONG> - Class: <STRONG>Start</STRONG> - Command-Line Switch: <STRONG>-start</STRONG> - - Specifies the amount of space to place between the left - or top edge of the tabset and the starting edge of its - tabs. For horizontally positioned tabs, this is the - amount of space between the left edge of the tabset and - the left edge of the first tab. For vertically posi- - tioned tabs, this is the amount of space between the - top of the tabset and the top of the first tab. This - value may change if the user performs a MButton-2 - scroll on the tabs. This value may have any of the - forms acceptable to <STRONG>Tk_GetPixels</STRONG>. - - Name: <STRONG>state</STRONG> - Class: <STRONG>State</STRONG> - Command-Line Switch: <STRONG>-state</STRONG> - - Sets the active state of the tabset. Specifying <STRONG>normal</STRONG> - allows all tabs to be selectable. Specifying <STRONG>disabled</STRONG> - disables the tabset causing all tabs to be drawn in the - disabledForeground color. - - Name: <STRONG>tabBorders</STRONG> - Class: <STRONG>TabBorders</STRONG> - Command-Line Switch: <STRONG>-tabborders</STRONG> - - Specifies whether to draw the borders of tabs that are - not selected. Specifying true (the default) draws these - borders, specifying false draws only the border around - the selected tab. The value may have any of the forms - accepted by the <STRONG>Tcl_GetBoolean</STRONG>, such as <STRONG>true</STRONG>, <STRONG>false,</STRONG> <STRONG>0</STRONG>, - <STRONG>1</STRONG>, <STRONG>yes</STRONG>, or <STRONG>no</STRONG>. - - Name: <STRONG>tabPos</STRONG> - Class: <STRONG>TabPos</STRONG> - Command-Line Switch: <STRONG>-tabpos</STRONG> - - Specifies the location of the set of tabs in relation - to another widget. Must be <STRONG>n</STRONG>, <STRONG>s</STRONG>, <STRONG>e</STRONG>, or <STRONG>w</STRONG>. Defaults to - <STRONG>s</STRONG>. North tabs open downward, South tabs open upward. - West tabs open to the right, east tabs open to the - left. - -</PRE> -<H2><HR ALIGN=LEFT WIDTH=70% SIZE=3></H2><PRE> - - -</PRE> -<H2>DESCRIPTION</H2><PRE> - The <STRONG>tabset</STRONG> command creates a new window (given by the path- - Name argument) and makes it into a <STRONG>tabset</STRONG> widget. Additional - <EM>options</EM>, described above may be specified on the command - line or in the option database to configure aspects of the - tabset such as its colors, font, and text. The <STRONG>tabset</STRONG> com- - mand returns its <EM>pathName</EM> argument. At the time this command - is invoked, there must not exist a window named <EM>pathName</EM>, - but pathName's parent must exist. - - A <STRONG>tabset</STRONG> is a widget that contains a set of Tab buttons. It - displays these tabs in a row or column depending on it tab- - pos. When a tab is clicked on, it becomes the only tab in - the tab set that is selected. All other tabs are deselected. - The Tcl command prefix associated with this tab (through the - command tab configure option) is invoked with the tab index - number appended to its argument list. This allows the tabset - to control another widget such as a Notebook. - - -</PRE> -<H2>TABS</H2><PRE> - Tabs are drawn to appear attached to another widget. The - tabset draws an edge boundary along one of its edges. This - edge is known as the attachment edge. This edge location is - dependent on the value of <STRONG>tabPos</STRONG>. For example, if <STRONG>tabPos</STRONG> is - <STRONG>s</STRONG>, the attachment edge wil be on the top side of the tabset - (in order to attach to the bottom or south side of its - attached widget). The selected tab is draw with a 3d relief - to appear above the other tabs. This selected tab "opens" - toward attachment edge. - - Tabs can be controlled in their location along the edges, - the angle that tab sides are drawn with, gap between tabs, - starting margin of tabs, internal padding around labels in a - tab, the font, and its text or bitmap. - - -</PRE> -<H2>WIDGET-SPECIFIC METHODS</H2><PRE> - The <STRONG>tabset</STRONG> command creates a new Tcl command whose name is - <EM>pathName</EM>. This command may be used to invoke various opera- - tions on the widget. It has the following general form: - - <EM>pathName</EM> <EM>option</EM> ?<EM>arg</EM> <EM>arg</EM> ...? - - <EM>option</EM> and the <EM>arg</EM>s determine the exact behavior of the com- - mand. - - Many of the widget commands for a tabset take as one argu- - ment an indicator of which tab of the tabset to operate on. - These indicators are called indexes and may be specified in - any of the following forms: - - <EM>number</EM> - Specifies the tab numerically, where 0 corresponds to - the first tab in the tab set, 1 to the second, and so - on. - - <STRONG>select</STRONG> - Specifies the currently selected tab's index. If no tab - is currently selected, the value -1 is returned. - - <STRONG>end</STRONG> Specifes the last tab in the tabset's index. If the - tabset is empty this will return -1. - - <EM>pattern</EM> - If the index doesn't satisfy any of the above forms, - then this form is used. Pattern is pattern-matched - against the label of each tab in the tabset, in order - from the first to the last tab, until a matching entry - is found. The rules of Tcl_StringMatch are used. - - The following commands are possible for tabset widgets: - - <EM>pathName</EM> <STRONG>add</STRONG> ?<EM>option</EM> <EM>value</EM> <EM>option</EM> <EM>value</EM> ...? - Add a new tab at the end of the tabset. Returns - the child site <EM>pathName</EM>. If additional arguments - are present, they specify any of the following - options: - - <STRONG>-angle</STRONG> <EM>value</EM> - Specifes the angle of slope from the inner - edge to the outer edge of the tab. An angle - of 0 specifies square tabs. Valid ranges are - 0 to 45 degrees inclusive. Default is 15 - degrees. If this option is specified as an - empty string (the default), then the angle - option for the overall tabset is used. - - <STRONG>-background</STRONG> <EM>value</EM> - Specifies a background color to use for - displaying tabs when they are in their normal - state (unselected). If this option is speci- - fied as an empty string (the default), then - the background option for the overall tabset - is used. - - <STRONG>-bevelamount</STRONG> <EM>value</EM> - Specifes the size of tab corners. A value of - 0 with angle set to 0 results in square tabs. - A bevelAmount of 4, means that the tab will - be drawn with angled corners that cut in 4 - pixels from the edge of the tab. The default - is 0. This is generally only set at the tab- - set configuration level. Tabs normally will - want to share the same bevelAmount. - - <STRONG>-bitmap</STRONG> <EM>value</EM> - If label is a non-empty string, specifies a - bitmap to display in the tab. Bitmap may be - of any of the forms accepted by Tk_GetBitmap. - - <STRONG>-disabledforeground</STRONG> <EM>value</EM> - Specifies a foreground color to use for - displaying tab labels when tabs are in their - disable state. If this option is specified as - an empty string (the default), then the disa- - bledforeground option for the overall tabset - is used. - - <STRONG>-font</STRONG> <EM>value</EM> - Specifies the font to use when drawing the - label on a tab. If this option is specified - as an empty string then the font option for - the overall tabset is used. - - <STRONG>-foreground</STRONG> <EM>value</EM> - 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 - tabset is used. - - <STRONG>-image</STRONG> <EM>value</EM> - If label is a non-empty string, specifies an - image to display in the tab. Image must have - been created with the image create command. - Typically, if the image option is specified - then it overrides other options that specify - a bitmap or textual value to display in the - widget; the image option may be reset to an - empty string to re-enable a bitmap or text - display. - - <STRONG>-label</STRONG> <EM>value</EM> - Specifies a text string to be placed in the - tabs label. If this value is set, the bitmap - option is overridden and this option is used - instead. This label serves as an additional - identifier used to reference the tab. This - label may be used for the index value in - widget commands. - - <STRONG>-selectbackground</STRONG> <EM>value</EM> - Specifies a background color to use for - displaying the selected tab. If this option - is specified as an empty string (the - default), then the selectBackground option - for the overall tabset is used. - - <STRONG>-selectforeground</STRONG> <EM>value</EM> - Specifies a foreground color to use for - displaying the selected tab. If this option - is specified as an empty string (the - default), then the selectForeground option - for the overall tabset is used. - - <STRONG>-padx</STRONG> <EM>value</EM> - Specifies a non-negative value indicating how - much extra space to request for a tab around - its label in the X-direction. When computing - how large a window it needs, the tab will add - this amount to the width it would normally - need The tab will end up with extra internal - space to the left and right of its text - label. This value may have any of the forms - acceptable to Tk_GetPixels. If this option is - specified as an empty string (the default), - then the padX option for the overall tabset - is used - - <STRONG>-pady</STRONG> <EM>value</EM> - Specifies a non-negative value indicating how - much extra space to request for a tab around - its label in the Y-direction. When computing - how large a window it needs, the tab will add - this amount to the height it would normally - need The tab will end up with extra internal - space to the top and bottom of its text - label. This value may have any of the forms - acceptable to Tk_GetPixels. If this option is - specified as an empty string (the default), - then the padY option for the overall tabset - is used - - <STRONG>-state</STRONG> <EM>value</EM> - Sets the state of the tab. Specifying normal - allows this tab to be selectable. Specifying - disabled disables the this tab causing its - tab label to be drawn in the disabledFore- - ground color. The tab will not respond to - events until the state is set back to normal. - - <EM>pathName</EM> <STRONG>configure</STRONG> ?<EM>option</EM>? ?<EM>value</EM> <EM>option</EM> <EM>value</EM> ...? - Query or modify the configuration options of the - widget. If no <EM>option</EM> is specified, returns a list - describing all of the available options for <EM>path-</EM> - <EM>Name</EM> (see <STRONG>Tk_ConfigureInfo</STRONG> for information on the - format of this list). If option is specified with - no value, then the command returns a list describ- - ing the one named option (this list will be ident- - ical 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. <EM>Option</EM> may have any of - the values accepted by the tabset command. - - <EM>pathName</EM> <STRONG>delete</STRONG> <EM>index1</EM> ?<EM>index2</EM>? - Delete all of the tabs between <EM>index1</EM> and <EM>index2</EM> - inclusive. If <EM>index2</EM> is omitted then it defaults - to <EM>index1</EM>. Returns an empty string. - - <EM>pathName</EM> <STRONG>index</STRONG> <EM>index</EM> - Returns the numerical index corresponding to - <EM>index</EM>. - - <EM>pathName</EM> <STRONG>insert</STRONG> <EM>index</EM> ?<EM>option</EM> <EM>value</EM> <EM>option</EM> <EM>value</EM> ...? - Insert a new tab in the tabset before the tab - specified by <EM>index</EM>. The additional arguments are - the same as for the <STRONG>add</STRONG> command. Returns the tab's - <EM>pathName</EM>. - - <EM>pathName</EM> <STRONG>next</STRONG> - Advances the selected tab to the next tab (order - is determined by insertion order). If the - currently selected tab is the last tab in the tab- - set, the selection wraps around to the first tab. - It behaves as if the user selected the next tab. - - <EM>pathName</EM> <STRONG>tabconfigure</STRONG> <EM>index</EM> ?<EM>option</EM>? ?<EM>value</EM>? - This command is similar to the <STRONG>configure</STRONG> command, - except that it applies to the options for an indi- - vidual tab, whereas configure applies to the - options for the tabset as a whole. Options may - have any of the values accepted by the <STRONG>add</STRONG> widget - command. If options are specified, options are - modified as indicated in the command and the com- - mand returns an empty string. If no options are - specified, returns a list describing the current - options for tab index (see <STRONG>Tk_ConfigureInfo</STRONG> for - information on the format of this list). - - <EM>pathName</EM> <STRONG>prev</STRONG> - Moves the selected tab to the previous tab (order - is determined by insertion order). If the - currently selected tab is the first tab in the - tabset, the selection wraps around to the last tab - in the tabset. It behaves as if the user selected - the previous tab. - - <EM>pathName</EM> <STRONG>select</STRONG> <EM>index</EM> - Selects the tab specified by <EM>index</EM> as the - currently selected tab. It behaves as if the user - selected the new tab. - - - -</PRE> -<H2>EXAMPLE</H2><PRE> - Following is an example that creates a tabset with two tabs - and a list box that the tabset controls. In addition select- - ing an item from the list also selects the corresponding - tab. - - # Define a proc that knows how to select an item - # from a list given an index from the tabset -command callback. - proc selectItem { item } { - .l selection clear [.l curselection] - .l selection set $item - .l see $item - - } - - # Define a proc that knows how to select a tab - # given a y pixel coordinate from the list.. - proc selectTab { y } { - set whichItem [.l nearest $y] - .ts select $whichItem - } - - # Create a listbox with two items (one and two) - # and bind button 1 press to the selectTab procedure. - listbox .l -selectmode single -exportselection false - .l insert end one - .l insert end two - .l selection set 0 - pack .l - bind .l <ButtonPress-1> { selectTab %y } - - # Create a tabset, set its -command to call selectItem - # Add two labels to the tabset (one and two). - tabset .ts -command selectItem - .ts add -label 1 - .ts add -label 2 - .ts select 0 - pack .ts -fill x -expand no - - -</PRE> -<H2>AUTHOR</H2><PRE> - Bill W. Scott - - -</PRE> -<H2>KEYWORDS</H2><PRE> - tab tabset notebook tabnotebook - - - - - - - - - - - - - - - - - - - - - -</PRE> -</BODY> -</HTML> +<TITLE>tabset - create and manipulate tabs as as set</TITLE> +<H1>tabset - create and manipulate tabs as as set</H1> + +</pre><H2>SYNOPSIS</H2> +<B>tabset</B> <I>pathName</I> ?<I>options</I>? +</pre><H2>INHERITANCE</H2> +itk::Widget <- tabset +</pre><H2>STANDARD OPTIONS</H2> +<P> +<table cellpadding=5> +<td valign=top> +<B>background</B><br> +<B>foreground</B><br> +<B>width</B><br> +</td> +<td valign=top> +<B>font</B><br> +<B>selectForeground</B><br> +</td> +<td valign=top> +<B>selectBackground</B><br> +<B>disabledForeground</B><br> +</td> +<td valign=top> +<B>cursor</B><br> +<B>height</B><br> +</td> +</table> +<P> +See the <A HREF="http://www.sco.com/Technology/tcl/man/tk_man/options.n.html"> "options" </A> manual entry for details on the standard options. +</pre><H2>WIDGET-SPECIFIC OPTIONS</H2> +<P> +<pre> +Name: <B>angle</B> +Class: <B>Angle</B> +Command-Line Switch: <B>-angle</B> +</pre> +<UL> +Specifes the angle of slope from the inner edge to the outer edge of the +tab. An angle of 0 specifies square tabs. Valid ranges are 0 to 45 degrees +inclusive. Default is 15 degrees. If tabPos is e or w, this option is ignored. +</UL> +<P> +<pre> +Name: <B>backdrop</B> +Class: <B>Backdrop</B> +Command-Line Switch: <B>-backdrop</B> +</pre> +<UL> +Specifies a background color to use when filling in the area behind the tabs. +</UL> +<P> +<pre> +Name: <B>bevelAmount</B> +Class: <B>BevelAmount</B> +Command-Line Switch: <B>-bevelamount</B> +</pre> +<UL> +Specifes the size of tab corners. A value of 0 with angle set to 0 results +in square tabs. A <B>bevelAmount</B> of 4, means that the tab will be +drawn with angled corners that cut in 4 pixels from the edge of the +tab. The default is 0. +</UL> +<P> +<pre> +Name: <B>command</B> +Class: <B>Command</B> +Command-Line Switch: <B>-command</B> +Specifes the prefix of a Tcl command to invoke to change the view in the +widget associated with the tabset. When a user selects a tab, a Tcl command +is invoked. The actual command consists of this option followed by a space +and a number. The number is the numerical index of the tab that has been +selected. +<P> +<table> +Name: <B>equalTabs</B> +Class: <B>EqualTabs</B> +Command-Line Switch: <B>-equaltabs</B> +</pre> +<UL> +Specifies whether to force tabs to be equal sized or not. A value +of <B>true</B> means constrain tabs to be equal sized. A value +of <B>false</B> allows each tab to size based on the text label size. The +value may have any of the forms accepted by the <B>Tcl_GetBoolean</B>, such +as <B>true</B>, <B>false</B>, <B>0</B>, <B>1</B>, <B>yes</B>, or <B>no</B>. +</UL> +<UL> +For horizontally positioned tabs (<B>tabPos</B> is either <B>s</B> +or <B>n</B>), <B>true</B> forces all tabs to be equal width (the width being +equal to the longest label plus any padX specified). Horizontal tabs are +always equal in height. +</UL> +<UL> +For vertically positioned tabs (<B>tabPos</B> is either <B>w</B> or <B>e</B>), +<B>true</B> forces all tabs to be equal height (the height being equal to +the height of the label with the largest font). Vertically oriented tabs are +always equal in width. +</UL> +<P> +<pre> +Name: <B>gap</B> +Class: <B>Gap</B> +Command-Line Switch: <B>-gap</B> +</pre> +<UL> +Specifies the amount of pixel space to place between each tab. Value may +be any pixel offset value. In addition, a special keyword <B>overlap</B> +can be used as the value to achieve a standard overlap of tabs. This value +may have any of the forms acceptable to <B>Tk_GetPixels</B>. +</UL> +<P> +<pre> +Name: <B>margin</B> +Class: <B>Margin</B> +Command-Line Switch: <B>-margin</B> +</pre> +<UL> +Specifies the amount of space to place between the outside edge of the +tabset and the outside edge of its tabs. If <B>tabPos</B> is <B>s</B>, this +is the amount of space between the bottom edge of the tabset and the +bottom edge of the set of tabs. If <B>tabPos</B> is <B>n</B>, this is the +amount of space between the top edge of the tabset and the top edge of the +set of tabs. If <B>tabPos</B> is <B>e</B>, this is the amount of space between +the right edge of the tabset and the right edge of the set of tabs. +If <B>tabPos</B> is <B>w</B>, this is the amount of space between the left +edge of the tabset and the left edge of the set of tabs. This value may +have any of the forms acceptable to <B>Tk_GetPixels</B>. +</UL> +<P> +<pre> +Name: <B>padX</B> +Class: <B>PadX</B> +Command-Line Switch: <B>-padx</B> +</pre> +<UL> +Specifies a non-negative value indicating how much extra space to request for +a tab around its label in the X-direction. When computing how large a +window it needs, the tab will add this amount to the width it would normally +need The tab will end up with extra internal space to the left and right of +its text label. This value may have any of the forms acceptable +to <B>Tk_GetPixels</B>. +</UL> +<P> +<pre> +Name: <B>padY</B> +Class: <B>PadY</B> +Command-Line Switch: <B>-pady</B> +</pre> +<UL> +Specifies a non-negative value indicating how much extra space to request +for a tab around its label in the Y-direction. When computing how large a +window it needs, the tab will add this amount to the height it would +normally need The tab will end up with extra internal space to the top and +bottom of its text label. This value may have any of the forms acceptable +to <B>Tk_GetPixels</B>. +</UL> +<P> +<pre> +Name: <B>raiseSelect</B> +Class: <B>RaiseSelect</B> +Command-Line Switch: <B>-raiseselect</B> +</pre> +<UL> +Specifes whether to slightly raise the selected tab from the rest of the +tabs. The selected tab is drawn 2 pixels closer to the outside edge of the +tabset than the unselected tabs. A value of true says to raise selected +tabs, a value of false turns this off. The default is false. The value may +have any of the forms accepted by the <B>Tcl_GetBoolean</B>, such +as <B>true</B>, <B>false</B>, <B>0</B>, <B>1</B>, <B>yes</B>, or <B>no</B>. +</UL> +<P> +<pre> +Name: <B>start</B> +Class: <B>Start</B> +Command-Line Switch: <B>-start</B> +</pre> +<UL> +Specifies the amount of space to place between the left or top edge of the +tabset and the starting edge of its tabs. For horizontally positioned tabs, +this is the amount of space between the left edge of the tabset and the left +edge of the first tab. For vertically positioned tabs, this is the amount +of space between the top of the tabset and the top of the first tab. This +value may change if the user performs a MButton-2 scroll on the tabs. This +value may have any of the forms acceptable to <B>Tk_GetPixels</B>. +</UL> +<P> +<pre> +Name: <B>state</B> +Class: <B>State</B> +Command-Line Switch: <B>-state</B> +</pre> +<UL> +Sets the active state of the tabset. Specifying <B>normal</B> allows all +tabs to be selectable. Specifying <B>disabled</B> disables the tabset +causing all tabs to be drawn in the disabledForeground color. +</UL> +<P> +<pre> +Name: <B>tabBorders</B> +Class: <B>TabBorders</B> +Command-Line Switch: <B>-tabborders</B> +</pre> +<UL> +Specifies whether to draw the borders of tabs that are not selected. +Specifying true (the default) draws these borders, specifying false +draws only the border around the selected tab. The value may have any +of the forms accepted by the <B>Tcl_GetBoolean</B>, such +as <B>true</B>, <B>false,</B> <B>0</B>, <B>1</B>, <B>yes</B>, or <B>no</B>. +</UL> +<P> +<pre> +Name: <B>tabPos</B> +Class: <B>TabPos</B> +Command-Line Switch: <B>-tabpos</B> +</pre> +<UL> +Specifies the location of the set of tabs in relation to another widget. Must +be <B>n</B>, <B>s</B>, <B>e</B>, or <B>w</B>. Defaults to <B>s</B>. North tabs +open downward, South tabs open upward. West tabs open to the right, east +tabs open to the left. +</UL> +</pre><HR> +</pre><H2>DESCRIPTION</H2> +<P> +The <B>tabset</B> command creates a new window (given by the pathName +argument) and makes it into a <B>tabset</B> widget. Additional <I>options</I>, +described above may be specified on the command line or in the option +database to configure aspects of the tabset such as its colors, font, and +text. The <B>tabset</B> command returns its <I>pathName</I> argument. At the +time this command is invoked, there must not exist a window +named <I>pathName</I>, but pathName's parent must exist. +<P> +A <B>tabset</B> is a widget that contains a set of Tab buttons. It displays +these tabs in a row or column depending on it tabpos. When a tab is +clicked on, it becomes the only tab in the tab set that is selected. All +other tabs are deselected. The Tcl command prefix associated with this +tab (through the command tab configure option) is invoked with the tab +index number appended to its argument list. This allows the tabset to +control another widget such as a Notebook. +</pre><H2>TABS</H2> +Tabs are drawn to appear attached to another widget. The tabset draws an +edge boundary along one of its edges. This edge is known as the attachment +edge. This edge location is dependent on the value of <B>tabPos</B>. For +example, if <B>tabPos</B> is <B>s</B>, the attachment edge wil be on the +top side of the tabset (in order to attach to the bottom or south side of +its attached widget). The selected tab is draw with a 3d relief to appear +above the other tabs. This selected tab "opens" toward attachment edge. +<P> +Tabs can be controlled in their location along the edges, the angle that +tab sides are drawn with, gap between tabs, starting margin of tabs, +internal padding around labels in a tab, the font, and its text or bitmap. +</pre><H2>WIDGET-SPECIFIC METHODS</H2> +<P> +The <B>tabset</B> command creates a new Tcl command whose name +is <I>pathName</I>. This command may be used to invoke various operations on +the widget. It has the following general form: +<pre> +<I>pathName option </I>?<I>arg arg ...</I>? +</pre> +<I>option</I> and the <I>arg</I>s +determine the exact behavior of the command. +<P> +Many of the widget commands for a tabset take as one argument an indicator +of which tab of the tabset to operate on. These indicators are called indexes +and may be specified in any of the following forms: +<DL> +<DT> <I>number</I> +</I></B> +<DD> Specifies the tab numerically, where 0 corresponds to the first tab in +the tab set, 1 to the second, and so on. +</DL> +<DL> +<DT> <B>select</B> +</I></B> +<DD> Specifies the currently selected tab's index. If no tab is currently +selected, the value -1 is returned. +</DL> +<DL> +<DT> <B>end</B> +</I></B> +<DD> Specifes the last tab in the tabset's index. If the tabset is empty this +will return -1. +</DL> +<DL> +<DT> <I>pattern</I> +</I></B> +<DD> If the index doesn't satisfy any of the above forms, then this form is +used. Pattern is pattern-matched against the label of each tab in the +tabset, in order from the first to the last tab, until a matching entry is +found. The rules of Tcl_StringMatch are used. +</DL> +<P> +'............................................................................. +The following commands are possible for tabset widgets: +<UL> +<DL> +<DT> <I>pathName</I> <B>add</B> ?<I>option</I> <I>value</I> <I>option</I> <I>value</I> ...? +</I></B> +<DD> Add a new tab at the end of the tabset. Returns the child +site <I>pathName</I>. If additional arguments are present, they specify +any of the following options: +</DL> +<UL> +<DL> +<DT> <B>-angle</B> <I>value</I> +</I></B> +<DD> Specifes the angle of slope from the inner edge to the outer edge of +the tab. An angle of 0 specifies square tabs. Valid ranges are 0 to +45 degrees inclusive. Default is 15 degrees. If this option is specified as +an empty string (the default), then the angle option for the overall tabset +is used. +</DL> +<DL> +<DT> <B>-background</B> <I>value</I> +</I></B> +<DD> Specifies a background color to use for displaying tabs when they are in +their normal state (unselected). If this option is specified as an empty +string (the default), then the background option for the overall tabset is +used. +</DL> +<DL> +<DT> <B>-bevelamount</B> <I>value</I> +</I></B> +<DD> Specifes the size of tab corners. A value of 0 with angle set to 0 results +in square tabs. A bevelAmount of 4, means that the tab will be drawn with +angled corners that cut in 4 pixels from the edge of the tab. The default is +0. This is generally only set at the tabset configuration level. Tabs +normally will want to share the same bevelAmount. +</DL> +<DL> +<DT> <B>-bitmap</B> <I>value</I> +</I></B> +<DD> If label is a non-empty string, specifies a bitmap to display in the +tab. Bitmap may be of any of the forms accepted by Tk_GetBitmap. +</DL> +<DL> +<DT> <B>-disabledforeground</B> <I>value</I> +</I></B> +<DD> Specifies a foreground color to use for displaying tab labels when tabs are +in their disable state. If this option is specified as an empty +string (the default), then the disabledforeground option for the overall +tabset is used. +</DL> +<DL> +<DT> <B>-font</B> <I>value</I> +</I></B> +<DD> Specifies the font to use when drawing the label on a tab. If this option +is specified as an empty string then the font option for the overall +tabset is used. +</DL> +<DL> +<DT> <B>-foreground</B> <I>value</I> +</I></B> +<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 +tabset is used. +</DL> +<DL> +<DT> <B>-image</B> <I>value</I> +</I></B> +<DD> If label is a non-empty string, specifies an image to display in the +tab. Image must have been created with the image create command. Typically, +if the image option is specified then it overrides other options that +specify a bitmap or textual value to display in the widget; the image +option may be reset to an empty string to re-enable a bitmap or text display. +</DL> +<DL> +<DT> <B>-label</B> <I>value</I> +</I></B> +<DD> Specifies a text string to be placed in the tabs label. If this value is +set, the bitmap option is overridden and this option is used instead. This +label serves as an additional identifier used to reference the tab. This +label may be used for the index value in widget commands. +</DL> +<DL> +<DT> <B>-selectbackground</B> <I>value</I> +</I></B> +<DD> Specifies a background color to use for displaying the selected tab. If +this option is specified as an empty string (the default), then the +selectBackground option for the overall tabset is used. +</DL> +<DL> +<DT> <B>-selectforeground</B> <I>value</I> +</I></B> +<DD> Specifies a foreground color to use for displaying the selected tab. If +this option is specified as an empty string (the default), then the +selectForeground option for the overall tabset is used. +</DL> +<DL> +<DT> <B>-padx</B> <I>value</I> +</I></B> +<DD> Specifies a non-negative value indicating how much extra space to request +for a tab around its label in the X-direction. When computing how large +a window it needs, the tab will add this amount to the width it would +normally need The tab will end up with extra internal space to the left +and right of its text label. This value may have any of the forms acceptable +to Tk_GetPixels. If this option is specified as an empty string (the +default), then the padX option for the overall tabset is used +</DL> +<DL> +<DT> <B>-pady</B> <I>value</I> +</I></B> +<DD> Specifies a non-negative value indicating how much extra space to request +for a tab around its label in the Y-direction. When computing how large +a window it needs, the tab will add this amount to the height it would +normally need The tab will end up with extra internal space to the top +and bottom of its text label. This value may have any of the forms +acceptable to Tk_GetPixels. If this option is specified as an empty +string (the default), then the padY option for the overall tabset is used +</DL> +<DL> +<DT> <B>-state</B> <I>value</I> +</I></B> +<DD> Sets the state of the tab. Specifying normal allows this tab to be +selectable. Specifying disabled disables the this tab causing its tab label +to be drawn in the disabledForeground color. The tab will not respond to +events until the state is set back to normal. +</DL> +</UL> +<DL> +<DT> <I>pathName</I> <B>configure</B> ?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...? +</I></B> +<DD> 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 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. <I>Option</I> may have any +of the values accepted by the tabset command. +</DL> +<DL> +<DT> <I>pathName</I> <B>delete</B> <I>index1</I> ?<I>index2</I>? +</I></B> +<DD> Delete all of the tabs 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. +</DL> +<DL> +<DT> <I>pathName</I> <B>index</B> <I>index</I> +</I></B> +<DD> Returns the numerical index corresponding to <I>index</I>. +</DL> +<DL> +<DT> <I>pathName</I> <B>insert</B> <I>index</I> ?<I>option</I> <I>value</I> <I>option</I> <I>value</I> ...? +</I></B> +<DD> Insert a new tab in the tabset before the tab specified by <I>index</I>. The +additional arguments are the same as for the <B>add</B> command. Returns +the tab's <I>pathName</I>. +</DL> +<DL> +<DT> <I>pathName</I> <B>next</B> +</I></B> +<DD> Advances the selected tab to the next tab (order is determined by insertion +order). If the currently selected tab is the last tab in the tabset, the +selection wraps around to the first tab. It behaves as if the user +selected the next tab. +</DL> +<DL> +<DT> <I>pathName</I> <B>tabconfigure</B> <I>index</I> ?<I>option</I>? ?<I>value</I>? +</I></B> +<DD> This command is similar to the <B>configure</B> command, except that it +applies to the options for an individual tab, whereas configure applies to +the options for the tabset as a whole. Options may have any of the values +accepted by the <B>add</B> 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 tab index (see <B>Tk_ConfigureInfo</B> for information on +the format of this list). +</DL> +<DL> +<DT> <I>pathName</I> <B>prev</B> +</I></B> +<DD> Moves the selected tab to the previous tab (order is determined by insertion +order). If the currently selected tab is the first tab in the tabset, the +selection wraps around to the last tab in the tabset. It behaves as if +the user selected the previous tab. +</DL> +<DL> +<DT> <I>pathName</I> <B>select</B> <I>index</I> +</I></B> +<DD> Selects the tab specified by <I>index</I> as the currently selected tab. It +behaves as if the user selected the new tab. + +</DL> +</pre><H2>EXAMPLE </H2> +<P> +Following is an example that creates a tabset with two tabs and a list box +that the tabset controls. In addition selecting an item from the list +also selects the corresponding tab. +<P> +<table cellpadding=5> +<td valign=top> +<UL><br> +a<br> +how<br> +item<br> +list<br> +from<br> +callback.<br> +item<br> +selection<br> +.l<br> +.l<br> +<UL><br> +proc<br> +to<br> +#<br> +pixel<br> +list..<br> +y<br> +whichItem<br> +.ts<br> +</UL><br> +a<br> +items<br> +#<br> +1<br> +selectTab<br> +-selectmode<br> +.l<br> +.l<br> +.l<br> +pack<br> +<ButtonPress-1><br> +}<br> +Create<br> +its<br> +selectItem<br> +labels<br> +(one<br> +.ts<br> +add<br> +add<br> +select<br> +-fill<br> +</UL><br> +</td> +<td valign=top> +</UL><br> +proc<br> +to<br> +#<br> +given<br> +the<br> +proc<br> +}<br> +clear<br> +selection<br> +see<br> +#<br> +that<br> +select<br> +given<br> +coordinate<br> +proc<br> +}<br> +[.l<br> +select<br> +<UL><br> +listbox<br> +(one<br> +and<br> +press<br> +procedure.<br> +single<br> +insert<br> +insert<br> +selection<br> +.l<br> +{<br> +</UL><br> +a<br> +-command<br> +#<br> +to<br> +and<br> +-command<br> +-label<br> +-label<br> +0<br> +x<br> +</td> +<td valign=top> +#<br> +that<br> +select<br> +from<br> +an<br> +tabset<br> +selectItem<br> +{<br> +[.l<br> +set<br> +$item<br> +Define<br> +knows<br> +a<br> +a<br> +from<br> +selectTab<br> +{<br> +nearest<br> +$whichItem<br> +#<br> +with<br> +and<br> +bind<br> +to<br> +listbox<br> +-exportselection<br> +end<br> +end<br> +set<br> +bind<br> +selectTab<br> +<UL><br> +tabset,<br> +to<br> +Add<br> +the<br> +two).<br> +selectItem<br> +1<br> +2<br> +pack<br> +-expand<br> +</td> +<td valign=top> +Define<br> +knows<br> +an<br> +a<br> +index<br> +-command<br> +{<br> +.l<br> +curselection]<br> +$item<br> +}<br> +a<br> +how<br> +tab<br> +y<br> +the<br> +{<br> +set<br> +$y]<br> +}<br> +Create<br> +two<br> +two)<br> +button<br> +the<br> +.l<br> +false<br> +one<br> +two<br> +0<br> +.l<br> +%y<br> +#<br> +set<br> +call<br> +two<br> +tabset<br> +tabset<br> +.ts<br> +.ts<br> +.ts<br> +.ts<br> +no<br> +</td> +</table> +</pre><H2>AUTHOR</H2> +Bill W. Scott +</pre><H2>KEYWORDS</H2> +tab tabset notebook tabnotebook |