Debian Codegraph @

html/tabset.html

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML>
3 <HEAD><TITLE>tabset manual page - BLT Built-In Commands</TITLE><!--#include virtual="/man/maninc.html"-->
4 <link rel="stylesheet" href="../docs.css" type="text/css" media="all">
5 </HEAD>
6 <BODY>
7 <DL>
8 <DD><A HREF="tabset.htm#M2" NAME="L3148">NAME</A>
9 <DL><DD>tabset - Create and manipulate tabset widgets</DD></DL>
10 <DD><A HREF="tabset.htm#M3" NAME="L3149">SYNOPSIS</A>
11 <DL>
12 </DL>
13 <DD><A HREF="tabset.htm#M4" NAME="L3150">DESCRIPTION</A>
14 <DD><A HREF="tabset.htm#M5" NAME="L3151">INTRODUCTION</A>
15 <DD><A HREF="tabset.htm#M6" NAME="L3152">SYNTAX</A>
16 <DD><A HREF="tabset.htm#M7" NAME="L3153">INDICES</A>
17 <DL class="indices">
18 <DD><A HREF="tabset.htm#M8" NAME="L3154"><I>number</I></A>
19 <DD><A HREF="tabset.htm#M9" NAME="L3155"><B>@</B><I>x</I><B>,</B><I>y</I></A>
20 <DD><A HREF="tabset.htm#M10" NAME="L3156"><B>select</B></A>
21 <DD><A HREF="tabset.htm#M11" NAME="L3157"><B>active</B></A>
22 <DD><A HREF="tabset.htm#M12" NAME="L3158"><B>focus</B></A>
23 <DD><A HREF="tabset.htm#M13" NAME="L3159"><B>down</B></A>
24 <DD><A HREF="tabset.htm#M14" NAME="L3160"><B>left</B></A>
25 <DD><A HREF="tabset.htm#M15" NAME="L3161"><B>right</B></A>
26 <DD><A HREF="tabset.htm#M16" NAME="L3162"><B>up</B></A>
27 <DD><A HREF="tabset.htm#M17" NAME="L3163"><B>end</B></A>
28 </DL>
29 <DD><A HREF="tabset.htm#M18" NAME="L3164">OPERATIONS</A>
30 <DL class="operations">
31 <DD><A HREF="tabset.htm#M19" NAME="L3165"><I>pathName </I><B>activate</B> <I>index</I></A>
32 <DD><A HREF="tabset.htm#M20" NAME="L3166"><I>pathName </I><B>bind</B> <I>tagName</I> ?<I>sequence</I>? ?<I>command</I>?</A>
33 <DD><A HREF="tabset.htm#M21" NAME="L3167"><I>pathName </I><B>cget</B> <I>option</I></A>
34 <DD><A HREF="tabset.htm#M22" NAME="L3168"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
35 <DD><A HREF="tabset.htm#M23" NAME="L3169"><I>pathName </I><B>delete </B><I>first </I>?<I>last</I>?</A>
36 <DD><A HREF="tabset.htm#M24" NAME="L3170"><I>pathName </I><B>focus </B><I>index</I></A>
37 <DD><A HREF="tabset.htm#M25" NAME="L3171"><I>pathName </I><B>get</B> <I>index</I></A>
38 <DD><A HREF="tabset.htm#M26" NAME="L3172"><I>pathName </I><B>hightlight</B> <I>index</I></A>
39 <DD><A HREF="tabset.htm#M27" NAME="L3173"><I>pathName </I><B>index</B> ?<I>flag</I>? <I>string</I></A>
40 <DD><A HREF="tabset.htm#M28" NAME="L3174"><I>pathName </I><B>insert</B> <I>position ?name ...</I>? ?<I>option value</I>?...</A>
41 <DD><A HREF="tabset.htm#M29" NAME="L3175"><I>pathName </I><B>invoke </B><I>index</I></A>
42 <DD><A HREF="tabset.htm#M30" NAME="L3176"><I>pathName </I><B>move</B> <I>index</I> <B>before</B>|<B>after</B> <I>index</I></A>
43 <DD><A HREF="tabset.htm#M31" NAME="L3177"><I>pathName </I><B>nearest</B> <I>x</I> <I>y</I> ?<I>varName</I></A>
44 <DD><A HREF="tabset.htm#M32" NAME="L3178"><I>pathName </I><B>perforation </B><I>operation</I> ?<I>args</I>?</A>
45 <DL class="operations">
46 <DD><A HREF="tabset.htm#M33" NAME="L3179"><I>pathName </I><B>perforation activate</B> <I>boolean</I></A>
47 <DD><A HREF="tabset.htm#M34" NAME="L3180"><I>pathName </I><B>perforation invoke</B></A>
48 </DL>
49 <DD><A HREF="tabset.htm#M35" NAME="L3181"><I>pathName </I><B>scan</B> <I>option args</I></A>
50 <DL class="operations">
51 <DD><A HREF="tabset.htm#M36" NAME="L3182"><I>pathName </I><B>scan mark </B><I>x y</I></A>
52 <DD><A HREF="tabset.htm#M37" NAME="L3183"><I>pathName </I><B>scan dragto </B><I>x y</I>.</A>
53 </DL>
54 <DD><A HREF="tabset.htm#M38" NAME="L3184"><I>pathName </I><B>see </B><I>index</I></A>
55 <DD><A HREF="tabset.htm#M39" NAME="L3185"><I>pathName </I><B>select </B><I>index</I></A>
56 <DD><A HREF="tabset.htm#M40" NAME="L3186"><I>pathName </I><B>size</B></A>
57 <DD><A HREF="tabset.htm#M41" NAME="L3187"><I>pathName </I><B>tab </B><I>operation</I> ?<I>args</I>?</A>
58 <DL class="operations">
59 <DD><A HREF="tabset.htm#M42" NAME="L3188"><I>pathName </I><B>tab cget</B> <I>nameOrIndex</I> <I>option</I></A>
60 <DD><A HREF="tabset.htm#M43" NAME="L3189"><I>pathName </I><B>tab configure</B> <I>nameOrIndex</I> ?<I>nameOrIndex</I>...? <I>option</I>? ?<I>value option value ...</I>?</A>
61 <DD><A HREF="tabset.htm#M44" NAME="L3190"><I>pathName </I><B>tab dockall</B></A>
62 <DD><A HREF="tabset.htm#M45" NAME="L3191"><I>pathName </I><B>tab names</B> ?<I>pattern</I>?</A>
63 <DD><A HREF="tabset.htm#M46" NAME="L3192"><I>pathName </I><B>tab pageheight</B></A>
64 <DD><A HREF="tabset.htm#M47" NAME="L3193"><I>pathName </I><B>tab pagewidth</B></A>
65 <DD><A HREF="tabset.htm#M48" NAME="L3194"><I>pathName </I><B>tab select </B><I>nameOrindex</I></A>
66 <DD><A HREF="tabset.htm#M49" NAME="L3195"><I>pathName </I><B>tab tearoff </B><I>index</I> ?<I>newName</I>?</A>
67 </DL>
68 <DD><A HREF="tabset.htm#M50" NAME="L3196"><I>pathName </I><B>view </B><I>args</I></A>
69 <DL class="operations">
70 <DD><A HREF="tabset.htm#M51" NAME="L3197"><I>pathName </I><B>view</B></A>
71 <DD><A HREF="tabset.htm#M52" NAME="L3198"><I>pathName </I><B>view moveto</B><I> fraction</I></A>
72 <DD><A HREF="tabset.htm#M53" NAME="L3199"><I>pathName </I><B>view scroll </B><I>number what</I></A>
73 </DL>
74 </DL>
75 <DD><A HREF="tabset.htm#M54" NAME="L3200">WIDGET OPTIONS</A>
76 <DL class="widget options">
77 <DD><A HREF="tabset.htm#M55" NAME="L3201"><B>-activebackground </B><I>color</I></A>
78 <DD><A HREF="tabset.htm#M56" NAME="L3202"><B>-activeforeground </B><I>color</I></A>
79 <DD><A HREF="tabset.htm#M57" NAME="L3203"><B>-anchor </B><I>anchor</I></A>
80 <DD><A HREF="tabset.htm#M58" NAME="L3204"><B>-background </B><I>color</I></A>
81 <DD><A HREF="tabset.htm#M59" NAME="L3205"><B>-borderwidth </B><I>pixels</I></A>
82 <DD><A HREF="tabset.htm#M60" NAME="L3206"><B>-cursor </B><I>cursor</I></A>
83 <DD><A HREF="tabset.htm#M61" NAME="L3207"><B>-dashes </B><I>dashList</I></A>
84 <DD><A HREF="tabset.htm#M62" NAME="L3208"><B>-endimage </B><I>imageName</I></A>
85 <DD><A HREF="tabset.htm#M63" NAME="L3209"><B>-font </B><I>fontName</I></A>
86 <DD><A HREF="tabset.htm#M64" NAME="L3210"><B>-foreground </B><I>color</I></A>
87 <DD><A HREF="tabset.htm#M65" NAME="L3211"><B>-gap </B><I>size</I></A>
88 <DD><A HREF="tabset.htm#M66" NAME="L3212"><B>-gapleft </B><I>size</I></A>
89 <DD><A HREF="tabset.htm#M67" NAME="L3213"><B>-height </B><I>pixels</I></A>
90 <DD><A HREF="tabset.htm#M68" NAME="L3214"><B>-highlightbackground </B><I>color</I></A>
91 <DD><A HREF="tabset.htm#M69" NAME="L3215"><B>-highlightcolor </B><I>color</I></A>
92 <DD><A HREF="tabset.htm#M70" NAME="L3216"><B>-highlightthickness </B><I>pixels</I></A>
93 <DD><A HREF="tabset.htm#M71" NAME="L3217"><B>-outerpad </B><I>pixels</I></A>
94 <DD><A HREF="tabset.htm#M72" NAME="L3218"><B>-pageheight </B><I>pixels</I></A>
95 <DD><A HREF="tabset.htm#M73" NAME="L3219"><B>-pagewidth </B><I>pixels</I></A>
96 <DD><A HREF="tabset.htm#M74" NAME="L3220"><B>-perforationcommand</B> <I>string</I></A>
97 <DD><A HREF="tabset.htm#M75" NAME="L3221"><B>-relief </B><I>relief</I></A>
98 <DD><A HREF="tabset.htm#M76" NAME="L3222"><B>-rotate </B><I>theta</I></A>
99 <DD><A HREF="tabset.htm#M77" NAME="L3223"><B>-samewidth </B><I>boolean</I></A>
100 <DD><A HREF="tabset.htm#M78" NAME="L3224"><B>-scrollcommand </B><I>string</I></A>
101 <DD><A HREF="tabset.htm#M79" NAME="L3225"><B>-scrollincrement </B><I>pixels</I></A>
102 <DD><A HREF="tabset.htm#M80" NAME="L3226"><B>-selectbackground </B><I>color</I></A>
103 <DD><A HREF="tabset.htm#M81" NAME="L3227"><B>-selectcommand </B><I>string</I></A>
104 <DD><A HREF="tabset.htm#M82" NAME="L3228"><B>-selectforeground </B><I>color</I>&#92;fB</A>
105 <DD><A HREF="tabset.htm#M83" NAME="L3229"><B>-selectpad </B><I>pixels</I>&#92;fB</A>
106 <DD><A HREF="tabset.htm#M84" NAME="L3230"><B>-side </B><I>side</I>&#92;fB</A>
107 <DL class="widget options">
108 <DD><A HREF="tabset.htm#M85" NAME="L3231"><B>top</B></A>
109 <DD><A HREF="tabset.htm#M86" NAME="L3232"><B>left</B></A>
110 <DD><A HREF="tabset.htm#M87" NAME="L3233"><B>right</B></A>
111 <DD><A HREF="tabset.htm#M88" NAME="L3234"><B>both</B></A>
112 </DL>
113 <DD><A HREF="tabset.htm#M89" NAME="L3235"><B>-slant </B><I>slant</I></A>
114 <DL class="widget options">
115 <DD><A HREF="tabset.htm#M90" NAME="L3236"><B>none</B></A>
116 <DD><A HREF="tabset.htm#M91" NAME="L3237"><B>left</B></A>
117 <DD><A HREF="tabset.htm#M92" NAME="L3238"><B>right</B></A>
118 <DD><A HREF="tabset.htm#M93" NAME="L3239"><B>both</B></A>
119 </DL>
120 <DD><A HREF="tabset.htm#M94" NAME="L3240"><B>-startimage </B><I>imageName</I></A>
121 <DD><A HREF="tabset.htm#M95" NAME="L3241"><B>-tabbackground </B><I>color</I></A>
122 <DD><A HREF="tabset.htm#M96" NAME="L3242"><B>-tabborderwidth </B><I>pixels</I></A>
123 <DD><A HREF="tabset.htm#M97" NAME="L3243"><B>-tabforeground </B><I>color</I></A>
124 <DD><A HREF="tabset.htm#M98" NAME="L3244"><B>-tabrelief </B><I>relief</I></A>
125 <DD><A HREF="tabset.htm#M99" NAME="L3245"><B>-takefocus</B> <I>focus</I></A>
126 <DD><A HREF="tabset.htm#M100" NAME="L3246"><B>-tearoff </B><I>boolean</I></A>
127 <DD><A HREF="tabset.htm#M101" NAME="L3247"><B>-transient </B><I>boolean</I></A>
128 <DD><A HREF="tabset.htm#M102" NAME="L3248"><B>-textside </B><I>side</I>&#92;fB</A>
129 <DD><A HREF="tabset.htm#M103" NAME="L3249"><B>-tiers </B><I>number</I>&#92;fB</A>
130 <DD><A HREF="tabset.htm#M104" NAME="L3250"><B>-tile </B><I>image</I></A>
131 <DD><A HREF="tabset.htm#M105" NAME="L3251"><B>-width </B><I>pixels</I></A>
132 </DL>
133 <DD><A HREF="tabset.htm#M106" NAME="L3252">TAB OPTIONS</A>
134 <DL class="tab options">
135 <DD><A HREF="tabset.htm#M107" NAME="L3253"><B>-activebackground </B><I>color</I></A>
136 <DD><A HREF="tabset.htm#M108" NAME="L3254"><B>-activeforeground </B><I>color</I></A>
137 <DD><A HREF="tabset.htm#M109" NAME="L3255"><B>-anchor </B><I>anchor</I></A>
138 <DD><A HREF="tabset.htm#M110" NAME="L3256"><B>-background </B><I>color</I></A>
139 <DD><A HREF="tabset.htm#M111" NAME="L3257"><B>-bindtags </B><I>tagList</I></A>
140 <DD><A HREF="tabset.htm#M112" NAME="L3258"><B>-command </B><I>string</I></A>
141 <DD><A HREF="tabset.htm#M113" NAME="L3259"><B>-data </B><I>string</I></A>
142 <DD><A HREF="tabset.htm#M114" NAME="L3260"><B>-fill </B><I>fill</I></A>
143 <DD><A HREF="tabset.htm#M115" NAME="L3261"><B>-font </B><I>fontName</I></A>
144 <DD><A HREF="tabset.htm#M116" NAME="L3262"><B>-foreground </B><I>color</I></A>
145 <DD><A HREF="tabset.htm#M117" NAME="L3263"><B>-image </B><I>imageName</I></A>
146 <DD><A HREF="tabset.htm#M118" NAME="L3264"><B>-leftimage </B><I>imageName</I></A>
147 <DD><A HREF="tabset.htm#M119" NAME="L3265"><B>-ipadx </B><I>pad</I></A>
148 <DD><A HREF="tabset.htm#M120" NAME="L3266"><B>-ipady </B><I>pad</I></A>
149 <DD><A HREF="tabset.htm#M121" NAME="L3267"><B>-padx </B><I>pad</I></A>
150 <DD><A HREF="tabset.htm#M122" NAME="L3268"><B>-pady </B><I>pad</I></A>
151 <DD><A HREF="tabset.htm#M123" NAME="L3269"><B>-selectbackground </B><I>color</I></A>
152 <DD><A HREF="tabset.htm#M124" NAME="L3270"><B>-shadow </B><I>color</I></A>
153 <DD><A HREF="tabset.htm#M125" NAME="L3271"><B>-state </B><I>state</I></A>
154 <DD><A HREF="tabset.htm#M126" NAME="L3272"><B>-stipple </B><I>bitmap</I></A>
155 <DD><A HREF="tabset.htm#M127" NAME="L3273"><B>-text </B><I>text</I></A>
156 <DD><A HREF="tabset.htm#M128" NAME="L3274"><B>-underline </B><I>num</I></A>
157 <DD><A HREF="tabset.htm#M129" NAME="L3275"><B>-window </B><I>pathName</I></A>
158 <DD><A HREF="tabset.htm#M130" NAME="L3276"><B>-windowheight </B><I>pixels</I></A>
159 <DD><A HREF="tabset.htm#M131" NAME="L3277"><B>-windowwidth </B><I>pixels</I></A>
160 </DL>
161 <DD><A HREF="tabset.htm#M132" NAME="L3278">DEFAULT BINDINGS</A>
162 <DL class="default bindings">
163 <DD><A HREF="tabset.htm#M133" NAME="L3279"><B>&lt;ButtonPress-2&gt;</B></A>
164 <DD><A HREF="tabset.htm#M134" NAME="L3280"><B>&lt;B2-Motion&gt;</B></A>
165 <DD><A HREF="tabset.htm#M135" NAME="L3281"><B>&lt;ButtonRelease-2&gt;</B></A>
166 <DD><A HREF="tabset.htm#M136" NAME="L3282"><B>&lt;KeyPress-Up&gt;</B></A>
167 <DD><A HREF="tabset.htm#M137" NAME="L3283"><B>&lt;KeyPress-Down&gt;</B></A>
168 <DD><A HREF="tabset.htm#M138" NAME="L3284"><B>&lt;KeyPress-Left&gt;</B></A>
169 <DD><A HREF="tabset.htm#M139" NAME="L3285"><B>&lt;KeyPress-Right&gt;</B></A>
170 <DD><A HREF="tabset.htm#M140" NAME="L3286"><B>&lt;KeyPress-space&gt;</B></A>
171 <DD><A HREF="tabset.htm#M141" NAME="L3287"><B>&lt;KeyPress-Return&gt;</B></A>
172 </DL>
173 <DL class="default bindings">
174 <DD><A HREF="tabset.htm#M142" NAME="L3288"><B>&lt;Enter&gt;</B></A>
175 <DD><A HREF="tabset.htm#M143" NAME="L3289"><B>&lt;Leave&gt;</B></A>
176 <DD><A HREF="tabset.htm#M144" NAME="L3290"><B>&lt;ButtonRelease-1&gt;</B></A>
177 <DD><A HREF="tabset.htm#M145" NAME="L3291"><B>&lt;ButtonRelease-3&gt;</B></A>
178 <DD><A HREF="tabset.htm#M146" NAME="L3292"><B>&lt;Control-ButtonRelease-1&gt;</B></A>
179 </DL>
180 <DD><A HREF="tabset.htm#M147" NAME="L3293">BIND TAGS</A>
181 <DD><A HREF="tabset.htm#M148" NAME="L3294">EXAMPLE</A>
182 <DD><A HREF="tabset.htm#M149" NAME="L3295">KEYWORDS</A>
183 </DL>
184 <H3><A NAME="M2">NAME</A></H3>
185 tabset - Create and manipulate tabset widgets
186 <H3><A NAME="M3">SYNOPSIS</A></H3>
187 <B>tabset</B> <I>pathName </I>?<I>options</I>?<BR>
188 <H3><A NAME="M4">DESCRIPTION</A></H3>
189 The <B>tabset</B> widget displays a series of overlapping folders. Only
190 the contents of one folder at a time is displayed. By clicking on the
191 tab's of a folder, you can view other folders. Each folder may
192 contain any Tk widget that can be automatically positioned and resized
193 in the folder.
194 <P>
195 There's no limit to the number of folders. Tabs can be tiered or
196 scrolled. Pages (i.e. embedded widgets) can be torn off and displayed
197 in another toplevel widget, and also restored. A tabset can also be
198 used as just a set of tabs, without a displaying any pages. You can
199 bind events to individual tabs, so it's easy to add features like
200 &quot;balloon help&quot;.
201 <H3><A NAME="M5">INTRODUCTION</A></H3>
202 Notebooks are a popular graphical paradigm. They allow you to organize
203 several windows that are too big to display at the same time as
204 pages of a notebook. For example, your application may display several
205 X-Y graphs at the same time. The graphs are too big to pack into the
206 same frame. Managing them in several <B><A HREF="../TkCmd/toplevel.htm">toplevel</A></B> widgets is
207 also cumbersome and clutters the screen. Instead, the <B>tabset</B> widget
208 organizes the graphs as folders in a notebook.
209 <P>
210 Only one page is visible at a time. When you click on a tab,
211 the folder corresponding to the tab is displayed in the <B>tabset</B>
212 widget. The tabset also lets you temporarily tear pages
213 out of the notebook into a separate toplevel widget, and put them back
214 in the tabset later. For example, you could compare two graphs side-by-side
215 by tearing them out, and then replace them when you are finished.
216 <P>
217 A tabset can contain any number of folders. If there are too
218 many tabs to view, you can arrange them as multiple tiers or scroll
219 the tabs. You can also attach Tk scrollbars to the tabset to scroll the tabs.
220 <H3><A NAME="M6">SYNTAX</A></H3>
221 The <B>tabset</B> command creates a new window using the <I>pathName</I>
222 argument and makes it into a tabset widget.
223 <dl><dd><table border="0"><tr><td><p style="font-size:12px;padding-left:.5em;padding-right:.5em;"><B>tabset </B><I>pathName </I>?<I>option value</I>?...</table></dl>
224 Additional options may be specified on the command line or in the
225 option database to configure aspects of the tabset such as its colors,
226 font, text, and relief. The <B>tabset</B> command returns its
227 <I>pathName</I> argument. At the time this command is invoked, there
228 must not exist a window named <I>pathName</I>, but <I>pathName</I>'s
229 parent must exist.
230 <P>
231 When first created, a new tabset contains no tabs. Tabs are added or
232 deleted using widget operations described below. It is not necessary
233 for all the tabs to be displayed in the tabset window at once;
234 commands described below may be used to change the view in the window.
235 Tabsets allow scrolling of tabs using the <B>-scrollcommand</B>
236 option. They also support scanning (see the <B><A HREF="../TclCmd/scan.htm">scan</A></B> operation).
237 Tabs may be arranged along any side of the tabset window using the
238 <B>-side</B> option.
239 <P>
240 The size of the tabset window is determined the number of tiers of
241 tabs and the sizes of the Tk widgets embedded inside each folder.
242 The widest widget determines the width of the folder. The tallest
243 determines the height. If no folders contain an embedded widget, the
•244 size is determined solely by the size of the tabs.
245 <P>
246 You can override either dimension with the tabset's <B>-width</B>
247 and <B>-height</B> options.
248 <H3><A NAME="M7">INDICES</A></H3>
249 Indices refer to individual tabs/folders in the tabset. Many of
250 the operations for tabset widgets take one or more indices as
251 arguments. An index may take several forms:
252 <P>
253 <DL class="indices">
254 <DT><A NAME="M8"><I>number</I></A><DD>
255 Unique node id of the tab.
256 <P><DT><A NAME="M9"><B>@</B><I>x</I><B>,</B><I>y</I></A><DD>
257 Tab that covers the point in the tabset window
258 specified by <I>x</I> and <I>y</I> (in screen coordinates). If no
259 tab covers that point, then the index is ignored.
260 <P><DT><A NAME="M10"><B>select</B></A><DD>
261 The currently selected tab. The <B>select</B> index is
262 typically changed by either clicking on the tab with the left mouse
263 button or using the widget's <B>invoke</B> operation.
264 <P><DT><A NAME="M11"><B>active</B></A><DD>
265 The tab where the mouse pointer is currently located. The label
266 is drawn using its active colors (see the <B>-activebackground</B> and
267 <B>-activeforeground</B> options). The <B>active</B> index is typically
268 changed by moving the mouse pointer over a tab or using the widget's
269 <B>activate</B> operation. There can be only one active tab at a time.
270 If there is no tab located under the mouse pointer, the index
271 is ignored.
272 <P><DT><A NAME="M12"><B>focus</B></A><DD>
273 Tab that currently has the widget's focus.
274 This tab is displayed with a dashed line around its label. You can
275 change this using the <B><A HREF="../TkCmd/focus.htm">focus</A></B> operation. If no tab has focus,
276 then the index is ignored.
277 <P><DT><A NAME="M13"><B>down</B></A><DD>
278 Tab immediately below the tab that currently has focus,
279 if there is one. If there is no tab below, the current
280 tab is returned.
281 <P><DT><A NAME="M14"><B>left</B></A><DD>
282 Tab immediately to the left the tab that currently has focus,
283 if there is one. If there is no tab to the left, the current
284 tab is returned.
285 <P><DT><A NAME="M15"><B>right</B></A><DD>
286 Tab immediately to the right the tab that currently has focus, if
287 there is one. If there is no tab to the right, the current tab is
288 returned.
289 <P><DT><A NAME="M16"><B>up</B></A><DD>
290 Tab immediately above, if there is one, to the tab that currently has
291 focus. If there is no tab above, the current tab is returned.
292 <P><DT><A NAME="M17"><B>end</B></A><DD>
293 Last tab in the tabset. If there are no tabs in the tabset then the
294 index is ignored.
295 <P></DL>
296 <P>
297 Some indices may not always be available. For example, if the mouse
298 is not over any tab, &quot;active&quot; does not have an index. For most
299 tabset operations this is harmless and ignored.
300 <H3><A NAME="M18">OPERATIONS</A></H3>
301 All <B>tabset</B> operations are invoked by specifying the widget's
302 pathname, the operation, and any arguments that pertain to that
303 operation. The general form is:
304 <P>
305 <dl><dd><table border="0"><tr><td><p style="font-size:12px;padding-left:.5em;padding-right:.5em;"><I>pathName operation </I>?<I>arg arg ...</I>?</table></dl>
306 <P>
307 <I>Operation</I> and the <I>arg</I>s determine the exact behavior of the
308 command. The following operations are available for tabset widgets:
309 <P>
310 <DL class="operations">
311 <DT><A NAME="M19"><I>pathName </I><B>activate</B> <I>index</I></A><DD>
312 Sets the active tab to the one indicated by <I>index</I>. The
313 active tab is drawn with its <I>active</I> colors (see the
314 <B>-activebackground</B> and <B>-activeforeground</B> options) and may
315 be retrieved with the index <B>active</B>. Only one tab may be active
316 at a time. If <I>index</I> is the empty string, then all tabs will
317 be drawn with their normal foreground and background colors.
318 <P><DT><A NAME="M20"><I>pathName </I><B>bind</B> <I>tagName</I> ?<I>sequence</I>? ?<I>command</I>?</A><DD>
319 Associates <I>command</I> with <I>tagName</I> such that whenever the
320 event sequence given by <I>sequence</I> occurs for a tab with this
321 tag, <I>command</I> will be invoked. The syntax is similar to the
322 <B><A HREF="../TkCmd/bind.htm">bind</A></B> command except that it operates on tabs, rather
323 than widgets. The tagName is one of <B>all</B>, <B>Perforation</B>,
324 or the name label used to create a Tab.
325 See the <B><A HREF="../TkCmd/bind.htm">bind</A></B> manual entry for
326 complete details on <I>sequence</I> and the substitutions performed on
327 <I>command</I>.
328 <P>
329 If all arguments are specified then a new binding is created, replacing
330 any existing binding for the same <I>sequence</I> and <I>tagName</I>.
331 If the first character of <I>command</I> is <B>+</B> then <I>command</I>
332 augments an existing binding rather than replacing it.
333 If no <I>command</I> argument is provided then the command currently
334 associated with <I>tagName</I> and <I>sequence</I> (it's an error occurs
335 if there's no such binding) is returned. If both <I>command</I> and
336 <I>sequence</I> are missing then a list of all the event sequences for
337 which bindings have been defined for <I>tagName</I>.
338 <P><DT><A NAME="M21"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
339 Returns the current value of the configuration option given
340 by <I>option</I>.
341 <I>Option</I> may have any of the values accepted by the <B>configure</B>
342 operation described in the section
343 below.
344 <P><DT><A NAME="M22"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
345 Query or modify the configuration options of the widget.
346 If no <I>option</I> is specified, returns a list describing all
347 the available options for <I>pathName</I> (see <B><A HREF="../TkLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
348 information on the format of this list). If <I>option</I> is specified
349 with no <I>value</I>, then the command returns a list describing the
350 one named option (this list will be identical to the corresponding
351 sublist of the value returned if no <I>option</I> is specified). If
352 one or more <I>option-value</I> pairs are specified, then the command
353 modifies the given widget option(s) to have the given value(s); in
354 this case the command returns an empty string.
355 <I>Option</I> and <I>value</I> are described in the section
356 below.
357 <P><DT><A NAME="M23"><I>pathName </I><B>delete </B><I>first </I>?<I>last</I>?</A><DD>
358 Deletes one or more tabs from the tabset. <I>First</I> and <I>last</I>
359 are the first and last indices, defining a range of tabs to be deleted.
360 If <I>last</I> isn't specified, then only the tab at <I>first</I>
361 is deleted.
362 <P><DT><A NAME="M24"><I>pathName </I><B>focus </B><I>index</I></A><DD>
363 Designates a tab to get the widget's focus. This tab is displayed
364 with a dashed line around its label.
365 <P><DT><A NAME="M25"><I>pathName </I><B>get</B> <I>index</I></A><DD>
366 Returns the name of the tab. The value of <I>index</I> may
367 be in any form described in the section
368 <P><DT><A NAME="M26"><I>pathName </I><B>hightlight</B> <I>index</I></A><DD>
369 Highlight a tab.
370 <P><DT><A NAME="M27"><I>pathName </I><B>index</B> ?<I>flag</I>? <I>string</I></A><DD>
371 Returns the node id of the tab specified by <I>string</I>. If
372 <I>flag</I> is <B>-name</B>, then <I>string</I> is the name of a tab.
373 If <I>flag</I> is <B>-index</B>, <I>string</I> is an index such as
374 &quot;active&quot; or &quot;focus&quot;.
375 If <I>flag</I> is <B>-both</B>, <I>string</I> is either.
376 If <I>flag</I> isn't specified, it defaults to
377 <B>-index</B>.
378 <P><DT><A NAME="M28"><I>pathName </I><B>insert</B> <I>position ?name ...</I>? ?<I>option value</I>?...</A><DD>
379 Inserts new tabs into the tabset. Tabs are inserted just before the
380 tab given by <I>position</I>. <I>Position</I> may be either a number,
381 indicating where in the list the new tab should be added, or <B>end</B>,
382 indicating that the new tab is to be added the end of the list.
383 <I>Name</I> is the symbolic name of the tab. <I>Be careful not to use
384 a number. Otherwise the tabset will confuse it with tab indices</I>. Returns
385 a list of indices for all the new tabs. If tab name is an empty
386 string, or ends in #auto, it is
387 generated using the given prefix. The list
388 of created tab names is returned.
389 <P><DT><A NAME="M29"><I>pathName </I><B>invoke </B><I>index</I></A><DD>
390 Selects the tab given by <I>index</I>, maps the tab's embedded widget, and
391 invokes the Tcl command associated with the tab, if there is one.
392 The return value is the return value from the Tcl command, or an empty
393 string if there is no command associated with the tab.
394 This command is ignored if the tab's state (see the <B>-state</B> option)
395 is disabled.
396 <P><DT><A NAME="M30"><I>pathName </I><B>move</B> <I>index</I> <B>before</B>|<B>after</B> <I>index</I></A><DD>
397 Moves the tab <I>index</I> to a new position in the tabset.
398 <P><DT><A NAME="M31"><I>pathName </I><B>nearest</B> <I>x</I> <I>y</I> ?<I>varName</I></A><DD>
399 Returns the name of the tab nearest to given X-Y screen coordinate.
400 If the argument <I>varName</I> is present,
401 this is a Tcl variable that is set to either <B><A HREF="../TkCmd/text.htm">text</A></B>,
402 <B>icon</B>, <B>icon2</B>, <B>startimage</B>, <B>endimage</B>,
403 <B>perforation</B> or the empty string depending
404 what part of the
405 tab the coordinate is over.
406 <P><DT><A NAME="M32"><I>pathName </I><B>perforation </B><I>operation</I> ?<I>args</I>?</A><DD>
407 This operation controls the perforation on the tab label.
408 <P>
409 <DL class="operations">
410 <DT><A NAME="M33"><I>pathName </I><B>perforation activate</B> <I>boolean</I></A><DD>
411 Set perforation active state to on or off.
412 <P><DT><A NAME="M34"><I>pathName </I><B>perforation invoke</B></A><DD>
413 Invokes the command specified for perforations (see the
414 <B>-perforationcommand</B> widget option). Typically this command
415 places the page into a top level widget. The name of the toplevel
416 is the concatonation of the <I>pathName</I>, &quot;-&quot;, and the <I>tabName</I>.
417 The return value is the return value from the Tcl command, or an empty
418 string if there is no command associated with the tab.
419 This command is ignored if the tab's state (see the <B>-state</B> option)
420 is disabled.
421 <P></DL>
422 <P><DT><A NAME="M35"><I>pathName </I><B>scan</B> <I>option args</I></A><DD>
423 This command implements scanning on tabsets. It has
424 two forms, depending on <I>option</I>:
425 <P>
426 <DL class="operations">
427 <DT><A NAME="M36"><I>pathName </I><B>scan mark </B><I>x y</I></A><DD>
428 Records <I>x</I> and <I>y</I> and the current view in the tabset
429 window; used with later <B>scan dragto</B> commands.
430 Typically this command is associated with a mouse button press in
431 the widget. It returns an empty string.
432 <P><DT><A NAME="M37"><I>pathName </I><B>scan dragto </B><I>x y</I>.</A><DD>
433 This command computes the difference between its <I>x</I> and <I>y</I>
434 arguments and the <I>x</I> and <I>y</I> arguments to the last
435 <B>scan mark</B> command for the widget.
436 It then adjusts the view by 10 times the
437 difference in coordinates. This command is typically associated
438 with mouse motion events in the widget, to produce the effect of
439 dragging the list at high speed through the window. The return
440 value is an empty string.
441 <P></DL>
442 <P><DT><A NAME="M38"><I>pathName </I><B>see </B><I>index</I></A><DD>
443 Scrolls the tabset so that the tab
444 <I>index</I> is visible in the widget's window.
445 <P><DT><A NAME="M39"><I>pathName </I><B>select </B><I>index</I></A><DD>
446 Select the tab.
447 <P><DT><A NAME="M40"><I>pathName </I><B>size</B></A><DD>
448 Returns the number of tabs in the tabset.
449 <P><DT><A NAME="M41"><I>pathName </I><B>tab </B><I>operation</I> ?<I>args</I>?</A><DD>
450 <P>
451 <DL class="operations">
452 <DT><A NAME="M42"><I>pathName </I><B>tab cget</B> <I>nameOrIndex</I> <I>option</I></A><DD>
453 Returns the current value of the configuration option given
454 by <I>option</I>.
455 <I>Option</I> may have any of the values accepted by the <B>tab configure</B>
456 operation described in the section
457 below.
458 <P><DT><A NAME="M43"><I>pathName </I><B>tab configure</B> <I>nameOrIndex</I> ?<I>nameOrIndex</I>...? <I>option</I>? ?<I>value option value ...</I>?</A><DD>
459 Query or modify the configuration options of one or more tabs.
460 If no <I>option</I> is specified, this operation returns a list
461 describing all the available options for <I>nameOrIndex</I>.
462 <I>NameOrIndex</I> can be either the name of a tab or its index. Names
463 of tabs take precedence over their indices. That means a tab named
464 <I>focus</I> is picked over the &quot;focus&quot; tab.
465 <P>
466 If <I>option</I> is specified, but not <I>value</I>, then a list describing the
467 one named option is returned. If one or more <I>option-value</I> pairs
468 are specified, then each named tab (specified by <I>nameOrIndex</I>) will
469 have its configurations option(s) set the given value(s). In
470 this last case, the empty string is returned.
471 <I>Option</I> and <I>value</I> are described in the section
472 below.
473 <P><DT><A NAME="M44"><I>pathName </I><B>tab dockall</B></A><DD>
474 Dock all tearoffs.
475 <P><DT><A NAME="M45"><I>pathName </I><B>tab names</B> ?<I>pattern</I>?</A><DD>
476 Returns the names of all the tabs matching the given pattern. If
477 no <I>pattern</I> argument is provided, then all tab names are returned.
478 <P><DT><A NAME="M46"><I>pathName </I><B>tab pageheight</B></A><DD>
479 <P><DT><A NAME="M47"><I>pathName </I><B>tab pagewidth</B></A><DD>
480 <P><DT><A NAME="M48"><I>pathName </I><B>tab select </B><I>nameOrindex</I></A><DD>
481 Select a tab by name or index, and cause it to become visible, selected,
482 activated, and receive focus. This is a shortform for using separate
483 commands.
484 <P><DT><A NAME="M49"><I>pathName </I><B>tab tearoff </B><I>index</I> ?<I>newName</I>?</A><DD>
485 Reparents the widget embedded into <I>index</I>, placing
486 it inside of <I>newName</I>. <I>NewName</I> is either the name of
487 an new widget that will contain the embedded widget or the name
488 of the <B>tabset</B> widget. It the last case, the embedded widget
489 is put back into the folder.
490 <P>
491 If no <I>newName</I> argument is provided, then the name of the current
492 parent of the embedded widget is returned.
493 <P></DL>
494 <P><DT><A NAME="M50"><I>pathName </I><B>view </B><I>args</I></A><DD>
495 This command queries or changes the position of the
496 tabset in the widget's window. It can take any of the following
497 forms:
498 <P>
499 <DL class="operations">
500 <DT><A NAME="M51"><I>pathName </I><B>view</B></A><DD>
501 Returns a list of two numbers between 0.0 and
502 1.0 that describe the amount and position of the tabset that is
503 visible in the window. For example, if <I>view</I> is &quot;0.2 0.6&quot;, 20%
504 of the tabset's text is off-screen to the left, 40% is visible in the
505 window, and 40% of the tabset is off-screen to the right. These are
506 the same values passed to scrollbars via the <B>-scrollcommand</B>
507 option.
508 <P><DT><A NAME="M52"><I>pathName </I><B>view moveto</B><I> fraction</I></A><DD>
509 Adjusts the view in the window so that <I>fraction</I> of the
510 total width of the tabset text is off-screen to the left.
511 <I>fraction</I> must be a number between 0.0 and 1.0.
512 <P><DT><A NAME="M53"><I>pathName </I><B>view scroll </B><I>number what</I></A><DD>
513 This command shifts the view in the window (left/top or right/bottom)
514 according to <I>number</I> and <I>what</I>. <I>Number</I> must be an
515 integer. <I>What</I> must be either <B>units</B> or <B>pages</B> or an
516 abbreviation of these. If <I>what</I> is <B>units</B>, the view adjusts
517 left or right by <I>number</I> scroll units (see the
518 <B>-scrollincrement</B> option). ; if it is <B>pages</B> then the view
519 adjusts by <I>number</I> widget windows. If <I>number</I> is negative
520 then tabs farther to the left become visible; if it is positive then
521 tabs farther to the right become visible.
522 <P></DL>
523 <P></DL>
524 <H3><A NAME="M54">WIDGET OPTIONS</A></H3>
525 Widget configuration options may be set either by the <B>configure</B>
526 operation or the Tk <B><A HREF="../TkCmd/option.htm">option</A></B> command. The resource class
527 is <B>Tabset</B>. The resource name is the name of the widget.
528 <PRE>option add *Tabset.Foreground white
529 option add *Tabset.Background blue</PRE>
530 The following widget options are available:
531 <P>
532 <DL class="widget options">
533 <DT><A NAME="M55"><B>-activebackground </B><I>color</I></A><DD>
534 Sets the default active background color for tabs. A tab is active
535 when the mouse is positioned over it or set by the <B>activate</B>
536 operation. Individual tabs may override this option by setting the
537 tab's <B>-activebackground</B> option.
538 <P><DT><A NAME="M56"><B>-activeforeground </B><I>color</I></A><DD>
539 Sets the default active foreground color for tabs. A tab is active
540 when the mouse is positioned over it or set by the <B>activate</B>
541 operation. Individual tabs may override this option by setting the
542 tab's <B>-activeforeground</B> option.
543 <P><DT><A NAME="M57"><B>-anchor </B><I>anchor</I></A><DD>
544 Anchors the tab's text (and images) to a particular edge of the tab.
545 The default value is <B>center</B>.
546 <P><DT><A NAME="M58"><B>-background </B><I>color</I></A><DD>
547 Sets the background color of the tabset.
548 <P><DT><A NAME="M59"><B>-borderwidth </B><I>pixels</I></A><DD>
549 Sets the width of the 3-D border around the outside edge of the widget. The
550 <B>-relief</B> option determines how the border is to be drawn. The
551 default is <B>2</B>.
552 <P><DT><A NAME="M60"><B>-cursor </B><I>cursor</I></A><DD>
553 Specifies the widget's cursor. The default cursor is <B>&quot;&quot;</B>.
554 <P><DT><A NAME="M61"><B>-dashes </B><I>dashList</I></A><DD>
555 Sets the dash style of the focus outline. When a tab has the widget's
556 focus, it is drawn with a dashed outline around its label.
557 <I>DashList</I> is a list of up
558 to 11 numbers that alternately represent the lengths of the dashes
559 and gaps on the cross hair lines. Each number must be between 1 and
560 255. If <I>dashList</I> is <B>&quot;&quot;</B>, the outline will be a solid
561 line. The default value is <B>5 2</B>.
562 <P><DT><A NAME="M62"><B>-endimage </B><I>imageName</I></A><DD>
563 Specify an image to be drawn after tabs (ie. on the right if -side = top).
564 This is used by
565 a binding looking for <I>endimage</I> from the <B>nearest</B> subcommand.
566 <P><DT><A NAME="M63"><B>-font </B><I>fontName</I></A><DD>
567 Sets the default font for the text in tab labels. Individual tabs may
568 override this by setting the tab's <B>-font</B> option. The default value is
569 <B>*-Helvetica-Bold-R-Normal-*-12-120-*</B>.
570 <P><DT><A NAME="M64"><B>-foreground </B><I>color</I></A><DD>
571 Sets the default color of tab labels. Individual tabs may
572 override this option by setting the tab's <B>-foreground</B> option.
573 The default value is <B>black</B>.
574 <P><DT><A NAME="M65"><B>-gap </B><I>size</I></A><DD>
575 Sets the gap (in pixels) between tabs. The default value is <B>2</B>.
576 <P><DT><A NAME="M66"><B>-gapleft </B><I>size</I></A><DD>
577 Sets a gap (in pixels) to leave between the text and -leftimage.
578 The default value is <B>2</B>.
579 <P><DT><A NAME="M67"><B>-height </B><I>pixels</I></A><DD>
580 Specifies the requested height of widget. If <I>pixels</I> is
581 0, then the height of the widget will be calculated based on
582 the size the tabs and their pages.
583 The default is <B>0</B>.
584 <P><DT><A NAME="M68"><B>-highlightbackground </B><I>color</I></A><DD>
585 Sets the color to display in the traversal highlight region when
586 the tabset does not have the input focus.
587 <P><DT><A NAME="M69"><B>-highlightcolor </B><I>color</I></A><DD>
588 Sets the color to use for the traversal highlight rectangle that is
589 drawn around the widget when it has the input focus.
590 The default is <B>black</B>.
591 <P><DT><A NAME="M70"><B>-highlightthickness </B><I>pixels</I></A><DD>
592 Sets the width of the highlight rectangle to draw around the outside of
593 the widget when it has the input focus. <I>Pixels</I> is a non-negative
594 value and may have any of the forms acceptable to <B><A HREF="../TkLib/GetPixels.htm">Tk_GetPixels</A></B>.
595 If the value is zero, no focus highlight is drawn around the widget.
596 The default is <B>2</B>.
597 <P><DT><A NAME="M71"><B>-outerpad </B><I>pixels</I></A><DD>
598 Padding around the exterior of the tabset and folder.
599 <P><DT><A NAME="M72"><B>-pageheight </B><I>pixels</I></A><DD>
600 Sets the requested height of the page. The page is the area under the
601 tab used to display the page contents. If <I>pixels</I> is <B>0</B>,
602 the maximum height of all embedded tab windows is used. The default
603 is <B>0</B>.
604 <P><DT><A NAME="M73"><B>-pagewidth </B><I>pixels</I></A><DD>
605 Sets the requested width of the page. The page is the area under the
606 tab used to display the page contents. If <I>pixels</I> is <B>0</B>,
607 the maximum width of all embedded tab windows is used. The default
608 is <B>0</B>.
609 <P><DT><A NAME="M74"><B>-perforationcommand</B> <I>string</I></A><DD>
610 Specifies a Tcl script to be invoked to tear off the current
611 page in the tabset. This command is typically invoked when
612 left mouse button is released over the tab perforation. The default
613 action is to tear-off the page and place it into a new toplevel
614 window.
615 <P><DT><A NAME="M75"><B>-relief </B><I>relief</I></A><DD>
616 Specifies the 3-D effect for the tabset widget. <I>Relief</I>
617 specifies how the tabset should appear relative to widget that
618 it is packed into; for example, <B>raised</B> means the tabset should
619 appear to protrude. The default is <B>sunken</B>.
620 <P><DT><A NAME="M76"><B>-rotate </B><I>theta</I></A><DD>
621 Specifies the degrees to rotate text in tab labels.
622 <I>Theta</I> is a real value representing the number of degrees
623 to rotate the tick labels. The default is <B>0.0</B> degrees.
624 <P><DT><A NAME="M77"><B>-samewidth </B><I>boolean</I></A><DD>
625 Indicates if each tab should be the same width. If true, each tab will
626 be as wide as the widest tab. The default is <B>no</B>.
627 <P><DT><A NAME="M78"><B>-scrollcommand </B><I>string</I></A><DD>
628 Specifies the prefix for a command for communicating with
629 scrollbars. Whenever the view in the widget's window
630 changes, the widget will generate a Tcl command by concatenating the
631 scroll command and two numbers. If this option is not specified, then
632 no command will be executed.
633 <P><DT><A NAME="M79"><B>-scrollincrement </B><I>pixels</I></A><DD>
634 Sets the smallest number of pixels to scroll the tabs.
635 If <I>pixels</I> is greater than 0, this sets the units for
636 scrolling (e.g., when you the change the view by clicking
637 on the left and right arrows of a scrollbar).
638 <P><DT><A NAME="M80"><B>-selectbackground </B><I>color</I></A><DD>
639 Sets the color to use when displaying background of the selected
640 tab. Individual tabs can override this option by setting the tab's
641 <B>-selectbackground</B> option.
642 <P><DT><A NAME="M81"><B>-selectcommand </B><I>string</I></A><DD>
643 Specifies a default Tcl script to be associated with tabs. This
644 command is typically invoked when left mouse button is released over
645 the tab. Individual tabs may override this with the tab's
646 <B>-command</B> option. The default value is <B>&quot;&quot;</B>.
647 <P><DT><A NAME="M82"><B>-selectforeground </B><I>color</I>&#92;fB</A><DD>
648 Sets the default color of the selected tab's text label.
649 Individual tabs can override this option by setting the tab's
650 <B>-selectforeground</B> option. The default value is <B>black</B>.
651 <P><DT><A NAME="M83"><B>-selectpad </B><I>pixels</I>&#92;fB</A><DD>
652 Specifies extra padding to be displayed around the selected tab.
653 The default value is <B>3</B>.
654 <P><DT><A NAME="M84"><B>-side </B><I>side</I>&#92;fB</A><DD>
655 Specifies the side of the widget to place tabs. The following
656 values are valid for <I>side</I>. The default value is <B>top</B>.
657 <P>
658 <DL class="widget options">
659 <DT><A NAME="M85"><B>top</B></A><DD>
660 Tabs are drawn along the top.
661 <P><DT><A NAME="M86"><B>left</B></A><DD>
662 Tabs are drawn along the left side.
663 <P><DT><A NAME="M87"><B>right</B></A><DD>
664 Tabs are drawn along the right side.
665 <P><DT><A NAME="M88"><B>both</B></A><DD>
666 Tabs are drawn along the bottom side.
667 <P></DL>
668 <P><DT><A NAME="M89"><B>-slant </B><I>slant</I></A><DD>
669 Specifies if the tabs should be slanted 45 degrees on the left and/or
670 right sides. The following values are valid for <I>slant</I>. The default
671 is <B>none</B>.
672 <P>
673 <DL class="widget options">
674 <DT><A NAME="M90"><B>none</B></A><DD>
675 Tabs are drawn as a rectangle.
676 <P><DT><A NAME="M91"><B>left</B></A><DD>
677 The left side of the tab is slanted.
678 <P><DT><A NAME="M92"><B>right</B></A><DD>
679 The right side of the tab is slanted.
680 <P><DT><A NAME="M93"><B>both</B></A><DD>
681 Boths sides of the tab are slanted.
682 <P></DL>
683 <P><DT><A NAME="M94"><B>-startimage </B><I>imageName</I></A><DD>
684 Specify an image to be drawn before tabs (ie. on the left if -side = top).
685 This is used by
686 a binding looking for <I>startimage</I> from the <B>nearest</B> subcommand.
687 <P><DT><A NAME="M95"><B>-tabbackground </B><I>color</I></A><DD>
688 Sets the default background color of tabs.
689 Individual tabs can override this option by setting the tab's
690 <B>-background</B> option.
691 <P><DT><A NAME="M96"><B>-tabborderwidth </B><I>pixels</I></A><DD>
692 Sets the width of the 3-D border around the outside edge of the tab. The
693 <B>-tabrelief</B> option determines how the border is to be drawn. The
694 default is <B>2</B>.
695 <P><DT><A NAME="M97"><B>-tabforeground </B><I>color</I></A><DD>
696 Specifies the color to use when displaying a tab's label.
697 Individual tabs can override this option by setting the tab's
698 <B>-foreground</B> option.
699 <P><DT><A NAME="M98"><B>-tabrelief </B><I>relief</I></A><DD>
700 Specifies the 3-D effect for both tabs and folders. <I>Relief</I>
701 specifies how the tabs should appear relative to background of the
702 widget; for example, <B>raised</B> means the tab should
703 appear to protrude. The default is <B>raised</B>.
704 <P><DT><A NAME="M99"><B>-takefocus</B> <I>focus</I></A><DD>
705 Provides information used when moving the focus from window to window
706 via keyboard traversal (e.g., Tab and Shift-Tab). If <I>focus</I> is
707 <B>0</B>, this means that this window should be skipped entirely during
708 keyboard traversal. <B>1</B> means that the this window should always
709 receive the input focus. An empty value means that the traversal
710 scripts decide whether to focus on the window.
711 The default is <B>1</B>.
712 <P><DT><A NAME="M100"><B>-tearoff </B><I>boolean</I></A><DD>
713 Display tearoff.
714 <P><DT><A NAME="M101"><B>-transient </B><I>boolean</I></A><DD>
715 Tearoff window should be transient.
716 <P><DT><A NAME="M102"><B>-textside </B><I>side</I>&#92;fB</A><DD>
717 If both images and text are specified for a tab, this option determines on
718 which side of the tab the text is to be displayed. The
719 valid sides are <B>left</B>, <B>right</B>, <B>top</B>, and
720 <B>bottom</B>. The default value is <B>left</B>.
721 <P><DT><A NAME="M103"><B>-tiers </B><I>number</I>&#92;fB</A><DD>
722 Specifies the maximum number of tiers to use to display the tabs.
723 The default value is <B>1</B>.
724 <P><DT><A NAME="M104"><B>-tile </B><I>image</I></A><DD>
725 Specifies a tiled background for the widget. If <I>image</I> isn't
726 <B>&quot;&quot;</B>, the background is tiled using <I>image</I>.
727 Otherwise, the normal background color is drawn (see the
728 <B>-background</B> option). <I>Image</I> must be an image created
729 using the Tk <B><A HREF="../TkCmd/image.htm">image</A></B> command. The default is <B>&quot;&quot;</B>.
730 <P><DT><A NAME="M105"><B>-width </B><I>pixels</I></A><DD>
731 Specifies the requested width of the widget. If <I>pixels</I> is
732 0, then the width of the widget will be calculated based on
733 the size the tabs and their pages.
734 The default is <B>0</B>.
735 <P></DL>
736 <H3><A NAME="M106">TAB OPTIONS</A></H3>
737 In addition to the <B>configure</B> operation, widget configuration
738 options may also be set by the Tk <B><A HREF="../TkCmd/option.htm">option</A></B> command. The class
739 resource name is <B>Tab</B>.
740 <PRE>option add *Tabset.Tab.Foreground white
741 option add *Tabset.name.Background blue</PRE>
742 The following widget options are available:
743 <P>
744 <DL class="tab options">
745 <DT><A NAME="M107"><B>-activebackground </B><I>color</I></A><DD>
746 Sets the active background color for <I>nameOrIndex</I>. A tab is active
747 when the mouse is positioned over it or set by the <B>activate</B>
748 operation. This overrides the widget's <B>-activebackground</B>
749 option.
750 <P><DT><A NAME="M108"><B>-activeforeground </B><I>color</I></A><DD>
751 Sets the default active foreground color <I>nameOrIndex</I>. A tab is &quot;active&quot;
752 when the mouse is positioned over it or set by the <B>activate</B>
753 operation. Individual tabs may override this option by setting the
754 tab's <B>-activeforeground</B> option.
755 <P><DT><A NAME="M109"><B>-anchor </B><I>anchor</I></A><DD>
756 Anchors the tab's embedded widget to a particular edge of the folder.
757 This option has effect only if the space in the folder surrounding the
758 embedded widget is larger than the widget itself. <I>Anchor</I> specifies
759 how the widget will be positioned in the extra space. For example, if
760 <I>anchor</I> is <B>center</B> then the window is centered in the folder
761 ; if <I>anchor</I> is <B>w</B> then the window will
762 be aligned with the leftmost edge of the folder. The default value is
763 <B>center</B>.
764 <P><DT><A NAME="M110"><B>-background </B><I>color</I></A><DD>
•765 Sets the background color for <I>nameOrIndex</I>. Setting this option overrides the
766 widget's <B>-tabbackground</B> option.
767 <P><DT><A NAME="M111"><B>-bindtags </B><I>tagList</I></A><DD>
768 Specifies the binding tags for this tab. <I>TagList</I> is a list of
769 binding tag names. The tags and their order will determine how
770 commands for events in tabs are invoked. Each tag in the list matching
771 the event sequence will have its Tcl command executed. Implicitly the
772 name of the tab is always the first tag in the list. The default value is
773 <B>all</B>.
774 <P><DT><A NAME="M112"><B>-command </B><I>string</I></A><DD>
775 Specifies a Tcl script to be associated with <I>nameOrIndex</I>. This
776 command is typically invoked when left mouse button is released over
777 the tab. Setting this option overrides the widget's
778 <B>-selectcommand</B> option.
779 <P><DT><A NAME="M113"><B>-data </B><I>string</I></A><DD>
780 Specifies a string to be associated with <I>nameOrIndex</I>.
781 This value isn't used in the widget code. It may be used in Tcl bindings
782 to associate extra data (other than the image or text) with the
783 tab. The default value is <B>&quot;&quot;</B>.
784 <P><DT><A NAME="M114"><B>-fill </B><I>fill</I></A><DD>
785 If the space in the folder surrounding the tab's embedded widget is
786 larger than the widget, then <I>fill</I> indicates if the embedded widget
787 should be stretched to occupy the extra space. <I>Fill</I> is either
788 <B>none</B>,
789 <B>x</B>, <B>y</B>, <B>both</B>. For example, if <I>fill</I> is <B>x</B>,
790 then the widget is stretched horizontally. If <I>fill</I> is <B>y</B>,
791 the widget is stretched vertically. The default is <B>none</B>.
792 <P><DT><A NAME="M115"><B>-font </B><I>fontName</I></A><DD>
793 Sets the font for the text in tab labels. If <I>fontName</I> is not
794 the empty string, this overrides the tabset's <B>-font</B> option.
795 The default value is <B>&quot;&quot;</B>.
796 <P><DT><A NAME="M116"><B>-foreground </B><I>color</I></A><DD>
797 Sets the color of the label for <I>nameOrIndex</I>. If <I>color</I>
798 is not the empty string, this overrides the widget's <B>-tabforeground</B>
799 option. The default value is <B>&quot;&quot;</B>.
800 <P><DT><A NAME="M117"><B>-image </B><I>imageName</I></A><DD>
801 Specifies the image to be drawn in label for <I>nameOrIndex</I>.
802 If <I>image</I> is <B>&quot;&quot;</B>, no image will be drawn. Both text and
803 images may be displayed at the same time in tab labels.
804 The default value is <B>&quot;&quot;</B>.
805 <P><DT><A NAME="M118"><B>-leftimage </B><I>imageName</I></A><DD>
806 Specify a second image to be drawn to the left before text/image when
807 the widgets -textside = right.
808 This image might represent a close icon when used with
809 a binding that looks for <I>icon2</I> from the <B>nearest</B> subcommand.
810 <P><DT><A NAME="M119"><B>-ipadx </B><I>pad</I></A><DD>
811 Sets the padding to the left and right of the label.
812 <I>Pad</I> can be a list of one or two screen distances. If <I>pad</I>
813 has two elements, the left side of the label is padded by the first
814 distance and the right side by the second. If <I>pad</I> has just one
815 distance, both the left and right sides are padded evenly. The
816 default value is <B>0</B>.
817 <P><DT><A NAME="M120"><B>-ipady </B><I>pad</I></A><DD>
818 Sets the padding to the top and bottom of the label.
819 <I>Pad</I> can be a list of one or two screen distances. If <I>pad</I>
820 has two elements, the top of the label is padded by the first
821 distance and the bottom by the second. If <I>pad</I> has just one
822 distance, both the top and bottom sides are padded evenly. The
823 default value is <B>0</B>.
824 <P><DT><A NAME="M121"><B>-padx </B><I>pad</I></A><DD>
825 Sets the padding around the left and right of the embedded widget, if
826 one exists.
827 <I>Pad</I> can be a list of one or two screen distances. If <I>pad</I>
828 has two elements, the left side of the widget is padded by the first
829 distance and the right side by the second. If <I>pad</I> has just one
830 distance, both the left and right sides are padded evenly. The
831 default value is <B>0</B>.
832 <P><DT><A NAME="M122"><B>-pady </B><I>pad</I></A><DD>
833 Sets the padding around the top and bottom of the embedded widget, if
834 one exists.
835 <I>Pad</I> can be a list of one or two screen distances. If <I>pad</I>
836 has two elements, the top of the widget is padded by the first
837 distance and the bottom by the second. If <I>pad</I> has just one
838 distance, both the top and bottom sides are padded evenly. The
839 default value is <B>0</B>.
840 <P><DT><A NAME="M123"><B>-selectbackground </B><I>color</I></A><DD>
841 Sets the color to use when displaying background of the selected
842 tab. If <I>color</I> is not the empty string, this overrides the
843 widget's <B>-selectbackground</B> option. The default value is
844 <B>&quot;&quot;</B>.
845 <P><DT><A NAME="M124"><B>-shadow </B><I>color</I></A><DD>
846 Sets the shadow color for the text in the tab's label. Drop shadows
847 are useful when both the foreground and background of the tab
848 have similar color intensities.
849 If <I>color</I> is the empty string, no shadow is drawn.
850 The default value is <B>&quot;&quot;</B>.
851 <P><DT><A NAME="M125"><B>-state </B><I>state</I></A><DD>
852 Sets the state of the tab. If <I>state</I> is <B>disable</B> the
853 text of the tab is drawn as engraved and operations on the tab
854 (such as <B>invoke</B> and <B>tab tearoff</B>) are ignored.
855 The default is <B>normal</B>.
856 <P><DT><A NAME="M126"><B>-stipple </B><I>bitmap</I></A><DD>
857 Specifies a stipple pattern to use for the background of the folder
858 when the window is torn off.
859 <I>Bitmap</I> specifies a bitmap to use as the stipple
860 pattern. The default is <B>BLT</B>.
861 <P><DT><A NAME="M127"><B>-text </B><I>text</I></A><DD>
862 Specifies the text of the tab's label. The exact way the text is
863 drawn may be affected by other options such as <B>-state</B> or
864 <B>-rotate</B>.
865 <P><DT><A NAME="M128"><B>-underline </B><I>num</I></A><DD>
866 Character to underline in text. Default is -1.
867 <P><DT><A NAME="M129"><B>-window </B><I>pathName</I></A><DD>
868 Specifies the widget to be embedded into the tab. <I>PathName</I> must
869 be a child of the <B>tabset</B> widget. The tabset will &quot;pack&quot; and
870 manage the size and placement of <I>pathName</I>.
871 The default value is <B>&quot;&quot;</B>.
872 <P><DT><A NAME="M130"><B>-windowheight </B><I>pixels</I></A><DD>
873 Sets the requested height of the page. The page is the area under the
874 tab used to display the page contents. If <I>pixels</I> is <B>0</B>,
875 the maximum height of all embedded tab windows is used. The default
876 is <B>0</B>.
877 <P><DT><A NAME="M131"><B>-windowwidth </B><I>pixels</I></A><DD>
878 Sets the requested width of the page. The page is the area under the
879 tab used to display the page contents. If <I>pixels</I> is <B>0</B>,
880 the maximum width of all embedded tab windows is used. The default
881 is <B>0</B>.
882 <P></DL>
883 <H3><A NAME="M132">DEFAULT BINDINGS</A></H3>
884 BLT automatically generates class bindings that supply tabsets their
885 default behaviors. The following event sequences are set by default
886 for tabsets (via the class bind tag <B>Tabset</B>):
887 <P>
888 <DL class="default bindings">
889 <DT><A NAME="M133"><B>&lt;ButtonPress-2&gt;</B></A><DD>
890 <P><DT><A NAME="M134"><B>&lt;B2-Motion&gt;</B></A><DD>
891 <P><DT><A NAME="M135"><B>&lt;ButtonRelease-2&gt;</B></A><DD>
892 Mouse button 2 may be used for scanning.
893 If it is pressed and dragged over the tabset, the contents of
894 the tabset drag at high speed in the direction the mouse moves.
895 <P><DT><A NAME="M136"><B>&lt;KeyPress-Up&gt;</B></A><DD>
896 <P><DT><A NAME="M137"><B>&lt;KeyPress-Down&gt;</B></A><DD>
897 The up and down arrow keys move the focus to the tab immediately above
898 or below the current focus tab. The tab with focus is drawn
899 with the a dashed outline around the tab label.
900 <P><DT><A NAME="M138"><B>&lt;KeyPress-Left&gt;</B></A><DD>
901 <P><DT><A NAME="M139"><B>&lt;KeyPress-Right&gt;</B></A><DD>
902 The left and right arrow keys move the focus to the tab immediately to the left
903 or right of the current focus tab. The tab with focus is drawn
904 with the a dashed outline around the tab label.
905 <P><DT><A NAME="M140"><B>&lt;KeyPress-space&gt;</B></A><DD>
906 <P><DT><A NAME="M141"><B>&lt;KeyPress-Return&gt;</B></A><DD>
907 The space and return keys select the current tab given focus.
908 When a folder is selected, it's command is invoked and the
909 embedded widget is mapped.
910 <P></DL>
911 <P>
912 Each tab, by default, also has a set of bindings (via the tag
913 <B>all</B>). These bindings may be reset using the tabset's
914 <B><A HREF="../TkCmd/bind.htm">bind</A></B> operation.
915 <P>
916 <DL class="default bindings">
917 <DT><A NAME="M142"><B>&lt;Enter&gt;</B></A><DD>
918 <P><DT><A NAME="M143"><B>&lt;Leave&gt;</B></A><DD>
919 When the mouse pointer enters a tab, it is activated (i.e. drawn in
920 its active colors) and when the pointer leaves, it is redrawn in
921 its normal colors.
922 <P><DT><A NAME="M144"><B>&lt;ButtonRelease-1&gt;</B></A><DD>
923 Clicking with the left mouse button on a tab causes the tab to be
924 selected and its Tcl script (see the <B>-command</B> or
925 <B>-selectcommand</B> options) to be invoked. The folder and any embedded
926 widget (if one is specified) is automatically mapped.
927 <P><DT><A NAME="M145"><B>&lt;ButtonRelease-3&gt;</B></A><DD>
928 <P><DT><A NAME="M146"><B>&lt;Control-ButtonRelease-1&gt;</B></A><DD>
929 Clicking on the right mouse button (or the left mouse button with the
930 Control key held down) tears off the current page into its own toplevel
931 widget. The embedded widget is re-packed into a new toplevel and
932 an outline of the widget is drawn in the folder. Clicking again
933 (toggling) will reverse this operation and replace the page back in
934 the folder.
935 <P></DL>
936 <H3><A NAME="M147">BIND TAGS</A></H3>
937 You can bind commands to tabs that are triggered when a particular
938 event sequence occurs in them, much like canvas items in Tk's
939 canvas widget. Not all event sequences are valid. The only binding
940 events that may be specified are those related to the mouse and
941 keyboard (such as <B>Enter</B>, <B>Leave</B>, <B>ButtonPress</B>,
942 <B>Motion</B>, and <B>KeyPress</B>).
943 <P>
944 It is possible for multiple bindings to match a particular event.
945 This could occur, for example, if one binding is associated with the
946 tab name and another is associated with the tab's tags
947 (see the <B>-bindtags</B> option). When this occurs, all the
948 matching bindings are invoked. A binding associated with the tab
949 name is invoked first, followed by one binding for each of the tab's
950 bindtags. If there are multiple matching bindings for a single tag,
951 then only the most specific binding is invoked. A continue command
952 in a binding script terminates that script, and a break command
953 terminates that script and skips any remaining scripts for the event,
954 just as for the bind command.
955 <P>
956 The <B>-bindtags</B> option for tabs controls addition tag names that
957 can be matched. Implicitly the first tag for each tab is its name.
958 Setting the value of the <B>-bindtags</B> option doesn't change this.
959 <P>
960 Note that the &lt;&lt;TabsetTearoff&gt;&gt; virtual event is generated on tearoff.
961 and the &lt;&lt;TabsetSelect&gt;&gt; virtual event is generated on selection.
962 <H3><A NAME="M148">EXAMPLE</A></H3>
963 You create a tabset widget with the <B>tabset</B> command.
964 <PRE># Create a new tabset
965 tabset .ts -relief sunken -borderwidth 2</PRE>
966 A new Tcl command <B>.ts</B> is also created. This command can be
967 used to query and modify the tabset. For example, to change the
968 default font used by all the tab labels, you use the new command and
969 the tabset's <B>configure</B> operation.
970 <PRE># Change the default font.
971 .ts configure -font &quot;fixed&quot;</PRE>
972 You can then add folders using the <B>insert</B> operation.
973 <PRE># Create a new folder &quot;f1&quot;
974 .ts insert 0 &quot;f1&quot;</PRE>
975 This inserts the new tab named &quot;f1&quot; into the tabset. The index
976 <B>0</B> indicates location to insert the new tab. You can also use
977 the index <B>end</B> to append a tab to the end of the tabset. By
978 default, the text of the tab is the name of the tab. You can change
979 this by configuring the <B>-text</B> option.
980 <PRE># Change the label of &quot;f1&quot;
981 .ts tab configure &quot;f1&quot; -text &quot;Tab #1&quot;</PRE>
982 The <B>insert</B> operation lets you add one or more folders at a time.
983 <PRE>.ts insert end &quot;f2&quot; -text &quot;Tab #2&quot; &quot;f3&quot; &quot;f4&quot;</PRE>
984 The tab on each folder contains a label. A label may display both
985 an image and a text string. You can reconfigure the tab's attributes
986 (foreground/background colors, font, rotation, etc) using the <B>tab
987 configure</B> operation.
988 <PRE># Add an image to the label of &quot;f1&quot;
989 set image [image create photo -file stopsign.gif]
990 .ts tab configure &quot;f1&quot; -image $image
991 .ts tab configure &quot;f2&quot; -rotate 90</PRE>
992 Each folder may contain an embedded widget to represent its contents.
993 The widget to be embedded must be a child of the tabset widget. Using
994 the <B>-window</B> option, you specify the name of widget to be
995 embedded. But don't pack the widget, the tabset takes care of placing
996 and arranging the widget for you.
997 <PRE>graph .ts.graph
998 .ts tab configure &quot;f1&quot; -window &quot;.ts.graph&quot; &#92;
999 -fill both -padx 0.25i -pady 0.25i</PRE>
1000 The size of the folder is determined the sizes of the Tk widgets
1001 embedded inside each folder. The folder will be as wide as the widest
1002 widget in any folder. The tallest determines the height. You can use
1003 the tab's <B>-pagewidth</B> and <B>-pageheight</B> options override this.
1004 <P>
1005 Other options control how the widget appears in the folder. The
1006 <B>-fill</B> option says that you wish to have the widget stretch to
1007 fill the available space in the folder.
1008 <PRE>.ts tab configure &quot;f1&quot; -fill both -padx 0.25i -pady 0.25i</PRE>
1009 <P>
1010 Now when you click the left mouse button on &quot;f1&quot;, the
1011 graph will be displayed in the folder. It will be automatically
1012 hidden when another folder is selected. If you click on the right
1013 mouse button, the embedded widget will be moved into a toplevel widget
1014 of its own. Clicking again on the right mouse button puts it back into
1015 the folder.
1016 <P>
1017 If you want to share a page between two different folders, the
1018 <B>-command</B> option lets you specify a Tcl command to be invoked
1019 whenever the folder is selected. You can reset the <B>-window</B>
1020 option for the tab whenever it's clicked.
1021 <PRE>.ts tab configure &quot;f2&quot; -command {
1022 .ts tab configure &quot;f2&quot; -window &quot;.ts.graph&quot;
1023 }
1024 .ts tab configure &quot;f1&quot; -command {
1025 .ts tab configure &quot;f1&quot; -window &quot;.ts.graph&quot;
1026 }</PRE>
1027 If you have many folders, you may wish to stack tabs in multiple
1028 tiers. The tabset's <B>-tiers</B> option requests a maximum
1029 number of tiers. The default is one tier.
1030 <PRE>.ts configure -tiers 2</PRE>
1031 If the tabs can fit in less tiers, the widget will use that many.
1032 Whenever there are more tabs than can be displayed in the maximum number
1033 of tiers, the tabset will automatically let you scroll the tabs. You
1034 can even attach a scrollbar to the tabset.
1035 <PRE>.ts configure -scrollcommand { .sbar set } -scrollincrement 20
1036 .sbar configure -orient horizontal -command { .ts view }</PRE>
1037 By default tabs are along the top of the tabset from left to right.
1038 But tabs can be placed on any side of the tabset using the <B>-side</B>
1039 option.
1040 <PRE># Arrange tabs along the right side of the tabset.
1041 .ts configure -side right -rotate 270</PRE>
1042 <H3><A NAME="M149">KEYWORDS</A></H3>
1043 <A href="../Keywords/T.htm#tabset">tabset</A>, <A href="../Keywords/W.htm#widget">widget</A>
1044 <div class="copy">Copyright &copy; 1995-1997 Roger E. Critchlow Jr.
1045 </div>
1046 </BODY></HTML>