1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1995 DSC Technologies Corporation
|
3 |
|
|
'\"
|
4 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
5 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
6 |
|
|
'\"
|
7 |
|
|
'\" @(#) tabnotebook.n
|
8 |
|
|
'/"
|
9 |
|
|
.so man.macros
|
10 |
|
|
.HS tabnotebook iwid
|
11 |
|
|
.BS
|
12 |
|
|
'\" Note: do not modify the .SH NAME line immediately below!
|
13 |
|
|
.SH NAME
|
14 |
|
|
tabnotebook \- create and manipulate tabnotebook widgets
|
15 |
|
|
.SH SYNOPSIS
|
16 |
|
|
\fBtabnotebook\fR \fIpathName\fR? \fIoptions\fR?
|
17 |
|
|
.SH "INHERITANCE"
|
18 |
|
|
itk::Widget <- tabnotebook
|
19 |
|
|
.SH "STANDARD OPTIONS"
|
20 |
|
|
.LP
|
21 |
|
|
.nf
|
22 |
|
|
.ta 4c 8c 12c
|
23 |
|
|
\fBbackground\fR \fBdisabledForeground\fR \fBforeground\fR \fBscrollCommand\fR
|
24 |
|
|
\fBcursor\fR \fBfont\fR \fBheight\fR \fBwidth\fR
|
25 |
|
|
.fi
|
26 |
|
|
.LP
|
27 |
|
|
See the "options" manual entry for details on the standard options.
|
28 |
|
|
.SH "WIDGET-SPECIFIC OPTIONS"
|
29 |
|
|
.LP
|
30 |
|
|
.nf
|
31 |
|
|
Name: \fBangle\fR
|
32 |
|
|
Class: \fBAngle\fR
|
33 |
|
|
Command-Line Switch: \fB-angle\fR
|
34 |
|
|
.fi
|
35 |
|
|
.IP
|
36 |
|
|
Specifes the angle of slope from the inner edge to the outer edge of the tab.
|
37 |
|
|
An angle of 0 specifies square tabs. Valid ranges are 0 to 45 degrees
|
38 |
|
|
inclusive. Default is 15 degrees. If \fBtabPos\fR is e or w, this option
|
39 |
|
|
is ignored.
|
40 |
|
|
.LP
|
41 |
|
|
.nf
|
42 |
|
|
Name: \fBauto\fR
|
43 |
|
|
Class: \fBAuto\fR
|
44 |
|
|
Command-Line Switch: \fB-auto\fR
|
45 |
|
|
.fi
|
46 |
|
|
.IP
|
47 |
|
|
Specifies whether to use the automatic packing/unpacking algorithm of the
|
48 |
|
|
notebook. A value of true indicates that page frames will be unpacked and
|
49 |
|
|
packed acoording to the algorithm described in the select command. A value
|
50 |
|
|
of \fBfalse\fR leaves the current page packed and
|
51 |
|
|
subsequent \fBselects\fR, \fBnext\fR, or \fBprevious\fR commands do not
|
52 |
|
|
switch pages automatically. In either case the page's associated
|
53 |
|
|
command (see the \fBadd\fR command's description of the command option) is
|
54 |
|
|
invoked. The value may have any of the forms accepted by
|
55 |
|
|
the \fBTcl_GetBoolean\fR, such as \fBtrue\fR, \fBfalse\fR, \fB0\fR,
|
56 |
|
|
\fB1\fR, \fByes\fR, or \fBno\fR.
|
57 |
|
|
.LP
|
58 |
|
|
.nf
|
59 |
|
|
Name: \fBbackdrop\fR
|
60 |
|
|
Class: \fBBackdrop\fR
|
61 |
|
|
Command-Line Switch: \fB-backdrop\fR
|
62 |
|
|
.fi
|
63 |
|
|
.IP
|
64 |
|
|
Specifies a background color to use when filling in the backdrop area
|
65 |
|
|
behind the tabs.
|
66 |
|
|
.LP
|
67 |
|
|
.nf
|
68 |
|
|
Name: \fBbackground\fR
|
69 |
|
|
Class: \fBBackground\fR
|
70 |
|
|
Command-Line Switch: \fB-background\fR
|
71 |
|
|
.fi
|
72 |
|
|
.IP
|
73 |
|
|
Specifies a background color to use for displaying a page and its associated
|
74 |
|
|
tab. This can be thought of as the selected tab background color, since the
|
75 |
|
|
tab associated with the selected page is the selected tab.
|
76 |
|
|
.LP
|
77 |
|
|
.nf
|
78 |
|
|
Name: \fBbevelAmount\fR
|
79 |
|
|
Class: \fBBevelAmount\fR
|
80 |
|
|
Command-Line Switch: \fB-bevelamount\fR
|
81 |
|
|
.fi
|
82 |
|
|
.IP
|
83 |
|
|
Specifes the size of tab corners. A value of 0 with \fBangle\fR set to
|
84 |
|
|
|
85 |
|
|
be drawn with angled corners that cut in 4 pixels from the edge of
|
86 |
|
|
the tab. The default is 0.
|
87 |
|
|
.LP
|
88 |
|
|
.nf
|
89 |
|
|
Name: \fBborderWidth\fR
|
90 |
|
|
Class: \fBBorderWidth\fR
|
91 |
|
|
Command-Line Switch: \fB-borderwidth\fR
|
92 |
|
|
.fi
|
93 |
|
|
.IP
|
94 |
|
|
Specifies the width of shadowed border to place around the notebook area of
|
95 |
|
|
the tabnotebook. The default value is 2.
|
96 |
|
|
.LP
|
97 |
|
|
.nf
|
98 |
|
|
Name: \fBdisabledForeground\fR
|
99 |
|
|
Class: \fBDisabledForeground\fR
|
100 |
|
|
Command-Line Switch: \fB-disabledforeground\fR
|
101 |
|
|
.fi
|
102 |
|
|
.IP
|
103 |
|
|
Specifies a foreground color to use for displaying a tab's label when
|
104 |
|
|
its \fBstate\fR is disabled.
|
105 |
|
|
.LP
|
106 |
|
|
.nf
|
107 |
|
|
Name: \fBequalTabs\fR
|
108 |
|
|
Class: \fBEqualTabs\fR
|
109 |
|
|
Command-Line Switch: \fB-equaltabs\fR
|
110 |
|
|
.fi
|
111 |
|
|
.IP
|
112 |
|
|
Specifies whether to force tabs to be equal sized or not. A value
|
113 |
|
|
of \fBtrue\fR means constrain tabs to be equal sized. A value
|
114 |
|
|
of \fBfalse\fR allows each tab to size based on the text label size. The
|
115 |
|
|
value may have any of the forms accepted by the \fBTcl_GetBoolean\fR, such
|
116 |
|
|
as \fBtrue\fR, \fBfalse\fR, \fB0\fR, \fB1\fR, \fByes\fR, or \fBno\fR.
|
117 |
|
|
.IP
|
118 |
|
|
For horizontally positioned tabs (\fBtabpos\fR is either \fBs\fR or \fBn\fR),
|
119 |
|
|
\fBtrue\fR forces all tabs to be equal width (the width being equal to
|
120 |
|
|
the longest label plus any \fBpadX\fR specified). Horizontal tabs are
|
121 |
|
|
always equal in height.
|
122 |
|
|
.IP
|
123 |
|
|
For vertically positioned tabs (\fBtabpos\fR is either \fBw\fR or \fBe\fR),
|
124 |
|
|
\fBtrue\fR forces all tabs to be equal height (the height being equal to the
|
125 |
|
|
height of the label with the largest font). Vertically oriented tabs
|
126 |
|
|
are always equal in width.
|
127 |
|
|
.LP
|
128 |
|
|
.nf
|
129 |
|
|
Name: \fBforeground\fR
|
130 |
|
|
Class: \fBForeground\fR
|
131 |
|
|
Command-Line Switch: \fB-foreground\fR
|
132 |
|
|
.fi
|
133 |
|
|
.IP
|
134 |
|
|
Specifies a foreground color to use for displaying a page and its associated
|
135 |
|
|
tab label. This can be thought of as the selected tab background color,
|
136 |
|
|
since the tab associated with the selected page is the selected tab.
|
137 |
|
|
.LP
|
138 |
|
|
.nf
|
139 |
|
|
Name: \fBgap\fR
|
140 |
|
|
Class: \fBGap\fR
|
141 |
|
|
Command-Line Switch: \fB-gap\fR
|
142 |
|
|
.fi
|
143 |
|
|
.IP
|
144 |
|
|
Specifies the amount of pixel space to place between each tab. Value may
|
145 |
|
|
be any pixel offset value. In addition, a special keyword \fBoverlap\fR
|
146 |
|
|
can be used as the value to achieve a standard overlap of tabs. This value
|
147 |
|
|
may have any of the forms acceptable to \fBTk_GetPixels\fR.
|
148 |
|
|
.LP
|
149 |
|
|
.nf
|
150 |
|
|
Name: \fBmargin\fR
|
151 |
|
|
Class: \fBMargin\fR
|
152 |
|
|
Command-Line Switch: \fB-Bmargin\fR
|
153 |
|
|
.fi
|
154 |
|
|
.IP
|
155 |
|
|
Specifies the amount of space to place between the outside edge of the
|
156 |
|
|
tabnotebook and the outside edge of its tabs. If \fBtabPos\fR is \fBs\fR,
|
157 |
|
|
this is the amount of space between the bottom edge of the tabnotebook and
|
158 |
|
|
the bottom edge of the set of tabs. If \fBtabPos\fR is \fBn\fR, this is
|
159 |
|
|
the amount of space between the top edge of the tabnotebook and the top
|
160 |
|
|
edge of the set of tabs. If \fBtabPos\fR is \fBe\fR, this is the amount of
|
161 |
|
|
space between the right edge of the tabnotebook and the right edge of the
|
162 |
|
|
set of tabs. If \fBtabPos\fR is \fBw\fR, this is the amount of space
|
163 |
|
|
between the left edge of the tabnotebook and the left edge of the set
|
164 |
|
|
of tabs. This value may have any of the forms acceptable to \fBTk_GetPixels\fR.
|
165 |
|
|
.LP
|
166 |
|
|
.nf
|
167 |
|
|
Name: \fBpadX\fR
|
168 |
|
|
Class: \fBPadX\fR
|
169 |
|
|
Command-Line Switch: \fB-padx\fR
|
170 |
|
|
.fi
|
171 |
|
|
.IP
|
172 |
|
|
Specifies a non-negative value indicating how much extra space to request
|
173 |
|
|
for a tab around its label in the X-direction. When computing how large
|
174 |
|
|
a window it needs, the tab will add this amount to the width it would
|
175 |
|
|
normally need The tab will end up with extra internal space to the left
|
176 |
|
|
and right of its text label. This value may have any of the forms acceptable
|
177 |
|
|
to \fBTk_GetPixels\fR.
|
178 |
|
|
.LP
|
179 |
|
|
.nf
|
180 |
|
|
Name: \fBpadY\fR
|
181 |
|
|
Class: \fBPadY\fR
|
182 |
|
|
Command-Line Switch: \fB-pady\fR
|
183 |
|
|
.fi
|
184 |
|
|
.IP
|
185 |
|
|
Specifies a non-negative value indicating how much extra space to request for
|
186 |
|
|
a tab around its label in the Y-direction. When computing how large a
|
187 |
|
|
window it needs, the tab will add this amount to the height it would normally
|
188 |
|
|
need The tab will end up with extra internal space to the top and bottom of
|
189 |
|
|
its text label. This value may have any of the forms acceptable
|
190 |
|
|
to \fBTk_GetPixels\fR.
|
191 |
|
|
.LP
|
192 |
|
|
.nf
|
193 |
|
|
Name: \fBraiseSelect\fR
|
194 |
|
|
Class: \fBRaiseSelect\fR
|
195 |
|
|
Command-Line Switch: \fB-raiseselect\fR
|
196 |
|
|
.fi
|
197 |
|
|
.IP
|
198 |
|
|
Specifes whether to slightly raise the selected tab from the rest of the
|
199 |
|
|
tabs. The selected tab is drawn 2 pixels closer to the outside of the
|
200 |
|
|
tabnotebook than the unselected tabs. A value of \fBtrue\fR says to
|
201 |
|
|
raise selected tabs, a value of \fBfalse\fR turns this feature off. The
|
202 |
|
|
default is \fBfalse\fR. The value may have any of the forms accepted
|
203 |
|
|
by the \fBTcl_GetBoolean\fR, such as \fBtrue\fR, \fBfalse\fR, \fB0\fR,
|
204 |
|
|
\fB1\fR, \fByes\fR, or \fBno\fR.
|
205 |
|
|
.LP
|
206 |
|
|
.nf
|
207 |
|
|
Name: \fBstart\fR
|
208 |
|
|
Class: \fBStart\fR
|
209 |
|
|
Command-Line Switch: \fB-start\fR
|
210 |
|
|
.fi
|
211 |
|
|
.IP
|
212 |
|
|
Specifies the amount of space to place between the left or top edge of the
|
213 |
|
|
tabnotebook and the starting edge of its tabs. For horizontally positioned
|
214 |
|
|
tabs, this is the amount of space between the left edge of the notebook and
|
215 |
|
|
the left edge of the first tab. For vertically positioned tabs, this is the
|
216 |
|
|
amount of space between the top of the notebook and the top of the first
|
217 |
|
|
tab. This value may change if the user performs a MButton-2 scroll on the
|
218 |
|
|
tabs. This value may have any of the forms acceptable to \fBTk_GetPixels\fR.
|
219 |
|
|
.LP
|
220 |
|
|
.nf
|
221 |
|
|
Name: \fBstate\fR
|
222 |
|
|
Class: \fBState\fR
|
223 |
|
|
Command-Line Switch: \fB-state\fR
|
224 |
|
|
.fi
|
225 |
|
|
.IP
|
226 |
|
|
Sets the active state of the tabnotebook. Specifying \fBnormal\fR allows
|
227 |
|
|
all pages to be selectable. Specifying \fBdisabled\fR disables the notebook
|
228 |
|
|
causing all page tabs to be drawn in the \fBdisabledForeground\fR color.
|
229 |
|
|
.LP
|
230 |
|
|
.nf
|
231 |
|
|
Name: \fBtabBackground\fR
|
232 |
|
|
Class: \fBTabBackground\fR
|
233 |
|
|
Command-Line Switch: \fB-tabbackground\fR
|
234 |
|
|
.fi
|
235 |
|
|
.IP
|
236 |
|
|
Specifies a background color to use for displaying tab backgrounds when
|
237 |
|
|
they are in their unselected state. This is the background associated with
|
238 |
|
|
tabs on all pages other than the selected page.
|
239 |
|
|
.LP
|
240 |
|
|
.nf
|
241 |
|
|
Name: \fBtabBorders\fR
|
242 |
|
|
Class: \fBTabBorders\fR
|
243 |
|
|
Command-Line Switch: \fB-tabborders\fR
|
244 |
|
|
.fi
|
245 |
|
|
.IP
|
246 |
|
|
Specifies whether to draw the borders of tabs that are not selected.
|
247 |
|
|
Specifying \fBtrue\fR (the default) draws these borders,
|
248 |
|
|
specifying \fBfalse\fR draws only the border around the selected tab. The
|
249 |
|
|
value may have any of the forms accepted by the \fBTcl_GetBoolean\fR,
|
250 |
|
|
such as \fBtrue\fR, \fBfalse\fR, \fB0\fR, \fB1\fR,\fB yes\fR, or \fBno\fR.
|
251 |
|
|
.LP
|
252 |
|
|
.nf
|
253 |
|
|
Name: \fBtabForeground\fR
|
254 |
|
|
Class: \fBTabForeground\fR
|
255 |
|
|
Command-Line Switch: \fB-tabforeground\fR
|
256 |
|
|
.fi
|
257 |
|
|
.IP
|
258 |
|
|
Specifies a foreground color to use for displaying tab labels when they
|
259 |
|
|
are in their unselected state. This is the foreground associated with tabs
|
260 |
|
|
on all pages other than the selected page.
|
261 |
|
|
.LP
|
262 |
|
|
.nf
|
263 |
|
|
Name: \fBtabPos\fR
|
264 |
|
|
Class: \fBTabPos\fR
|
265 |
|
|
Command-Line Switch: \fB-tabpos\fR
|
266 |
|
|
.fi
|
267 |
|
|
.IP
|
268 |
|
|
Specifies the location of the set of tabs in relation to the notebook
|
269 |
|
|
area. Must be n, s, e, or w. Defaults to s.
|
270 |
|
|
.BE
|
271 |
|
|
.SH DESCRIPTION
|
272 |
|
|
.PP
|
273 |
|
|
The \fBtabnotebook\fR command creates a new window (given by the pathName
|
274 |
|
|
argument) and makes it into a \fBtabnotebook\fR widget. Additional options,
|
275 |
|
|
described above may be specified on the command line or in the option
|
276 |
|
|
database to configure aspects of the tabnotebook such as its colors, font,
|
277 |
|
|
and text. The tabnotebook command returns its pathName argument. At the
|
278 |
|
|
time this command is invoked, there must not exist a window named
|
279 |
|
|
pathName, but pathName's parent must exist.
|
280 |
|
|
.PP
|
281 |
|
|
A \fBtabnotebook\fR is a widget that contains a set of tabbed pages. It
|
282 |
|
|
displays one page from the set as the selected page. A Tab displays the
|
283 |
|
|
label for the page to which it is attached and serves as a page
|
284 |
|
|
selector. When a page's tab is selected, the page's contents are displayed
|
285 |
|
|
in the page area. The selected tab has a three-dimensional effect to make
|
286 |
|
|
it appear to float above the other tabs. The tabs are displayed as a group
|
287 |
|
|
along either the left, top, right, or bottom edge. When first created a
|
288 |
|
|
tabnotebook has no pages. Pages may be added or deleted using widget
|
289 |
|
|
commands described below.
|
290 |
|
|
.PP
|
291 |
|
|
A special option may be provided to the tabnotebook. The \fB-auto\fR
|
292 |
|
|
option specifies whether the tabnotebook will automatically handle the
|
293 |
|
|
unpacking and packing of pages when pages are selected. A value of
|
294 |
|
|
true signifies that the notebook will automatically manage it. This is the
|
295 |
|
|
default value. A value of false signifies the notebook will not perform
|
296 |
|
|
automatic switching of pages.
|
297 |
|
|
.SH NOTEBOOK PAGES
|
298 |
|
|
A tabnotebook's pages area contains a single child site frame. When a
|
299 |
|
|
new page is created it is a child of this frame. The page's child site
|
300 |
|
|
frame serves as a geometry container for applications to pack widgets
|
301 |
|
|
into. It is this frame that is automatically unpacked or packed when
|
302 |
|
|
the auto option is true. This creates the effect of one page being visible
|
303 |
|
|
at a time. When a new page is selected, the previously selected page's
|
304 |
|
|
child site frame is automatically unpacked from the tabnotebook's child
|
305 |
|
|
site frame and the newly selected page's child site is packed into the
|
306 |
|
|
tabnotebook's child site frame.
|
307 |
|
|
.PP
|
308 |
|
|
However, sometimes it is desirable to handle page changes in a different
|
309 |
|
|
manner. By specifying the \fBauto\fR option as \fBfalse\fR, child site
|
310 |
|
|
packing can be disabled and done differently. For example, all widgets
|
311 |
|
|
might be packed into the first page's child site \fBframe\fR. Then when
|
312 |
|
|
a new page is selected, the application can reconfigure the widgets
|
313 |
|
|
and give the appearance that the page was flipped.
|
314 |
|
|
.PP
|
315 |
|
|
In both cases the command option for a page specifies a Tcl Command
|
316 |
|
|
to execute when the page is selected. In the case of \fBauto\fR
|
317 |
|
|
being \fBtrue\fR, it is between the unpacking of the previously selected
|
318 |
|
|
page and the packing of the newly selected page.
|
319 |
|
|
.PP
|
320 |
|
|
Notebook pages can also be controlled with scroll bars or other widgets
|
321 |
|
|
that obey the \fBscrollcommand\fR protocol. By giving a scrollbar
|
322 |
|
|
a \fB-command\fR to call the tabnotebook's \fBselect\fR method, the
|
323 |
|
|
tabnotebook can be controlled with a scrollbar.
|
324 |
|
|
.PP
|
325 |
|
|
The notebook area is implemented with the notebook mega widget.
|
326 |
|
|
.SH TABS
|
327 |
|
|
Tabs appear along the edge of the notebook area. Tabs are drawn to appear
|
328 |
|
|
attached to their associated page. When a tab is clicked on, the associated
|
329 |
|
|
page is selected and the tab is drawn as raised above all other tabs and as
|
330 |
|
|
a seamless part of its notebook page. Tabs can be controlled in their
|
331 |
|
|
location along the edges, the angle tab sides are drawn with, gap between
|
332 |
|
|
tabs, starting margin of tabs, internal padding around text labels in
|
333 |
|
|
a tab, the font, and its label.
|
334 |
|
|
.PP
|
335 |
|
|
The Tab area is implemented with the \fBtabset\fR mega widget.
|
336 |
|
|
See \fBtabset(1)\fR. Tabs may be oriented along either the north, south,
|
337 |
|
|
east, or west sides with the \fBtabPos\fR option. North and south tabs
|
338 |
|
|
may appear as angled, square, or bevelled. West and east tabs may appear
|
339 |
|
|
as square or bevelled. By changing tab gaps, tab angles, bevelling,
|
340 |
|
|
orientations, colors, fonts, start locations, and margins; tabs may appear
|
341 |
|
|
in a wide variety of styles. For example, it is possible to implement
|
342 |
|
|
Microsoft-style tabs, Borland property tab styles, or Borland Delphi
|
343 |
|
|
style tabs all with the same tabnotebook.
|
344 |
|
|
.SH "WIDGET-SPECIFIC METHODS"
|
345 |
|
|
.PP
|
346 |
|
|
The \fBtabnotebook\fR command creates a new Tcl command whose name
|
347 |
|
|
is \fIpathName\fR. This command may be used to invoke various operations
|
348 |
|
|
on the widget. It has the following general form:
|
349 |
|
|
.DS C
|
350 |
|
|
\fIpathName option \fR?\fIarg arg ...\fR?
|
351 |
|
|
.DE
|
352 |
|
|
\fIoption\fR and the \fIarg\fRs
|
353 |
|
|
determine the exact behavior of the command.
|
354 |
|
|
.PP
|
355 |
|
|
Many of the widget commands for a notebook take as one argument an
|
356 |
|
|
indicator of which page of the notebook to operate on. These indicators are
|
357 |
|
|
called indexes and may be specified in any of the following forms:
|
358 |
|
|
.TP
|
359 |
|
|
\fInumber\fR
|
360 |
|
|
Specifies the page numerically, where 0 corresponds to the first page
|
361 |
|
|
in the notebook, 1 to the second, and so on.
|
362 |
|
|
.TP
|
363 |
|
|
\fBselect\fR
|
364 |
|
|
Specifies the currently selected page's index. If no page is currently
|
365 |
|
|
selected, the value -1 is returned.
|
366 |
|
|
.TP
|
367 |
|
|
\fBend\fR
|
368 |
|
|
Specifes the last page in the tabnotebook's index. If the notebook is empty
|
369 |
|
|
this will return -1.
|
370 |
|
|
.TP
|
371 |
|
|
\fIpattern\fR
|
372 |
|
|
If the index doesn't satisfy any of the above forms, then this form is
|
373 |
|
|
used. Pattern is pattern-matched against the label of each page in the
|
374 |
|
|
notebook, in order from the first to the last page, until a matching entry
|
375 |
|
|
is found. The rules of Tcl_StringMatch are used.
|
376 |
|
|
'.............................................................................
|
377 |
|
|
The following commands are possible for tabnotebook widgets:
|
378 |
|
|
.TP
|
379 |
|
|
\fIpathName\fR \fBadd\fR ?\fIoption\fR \fIvalue\fR \fIoption\fR \fIvalue\fR ...?
|
380 |
|
|
Add a new page at the end of the tabnotebook. A new child site frame is
|
381 |
|
|
created. Returns the child site pathName. If additional arguments are
|
382 |
|
|
present, they specify any of the following options:
|
383 |
|
|
.RS
|
384 |
|
|
.TP
|
385 |
|
|
\fB-angle\fR \fIvalue\fR
|
386 |
|
|
Specifes the angle of slope from the inner edge to the outer edge of the
|
387 |
|
|
tab. An angle of 0 specifies square tabs. Valid ranges are 0 to 45 degrees
|
388 |
|
|
inclusive. Default is 15 degrees. If this option is specified as an empty
|
389 |
|
|
string (the default), then the angle option for the overall tabnotebook
|
390 |
|
|
is used. This is generally only set at the tabnotebook level. Tabs normally
|
391 |
|
|
will want to share the same angle value.
|
392 |
|
|
.TP
|
393 |
|
|
\fB-background\fR \fIvalue\fR
|
394 |
|
|
Specifies a background color to use for displaying tabs when they are
|
395 |
|
|
selected and for displaying the current page. If this option is specified
|
396 |
|
|
as an empty string (the default), then the background option for the
|
397 |
|
|
overall tabnotebook is used.
|
398 |
|
|
.TP
|
399 |
|
|
\fB-bevelamount\fR \fIvalue\fR
|
400 |
|
|
Specifes the size of tab corners. A value of 0 with angle set to 0
|
401 |
|
|
results in square tabs. A bevelAmount of 4, means that the tab will be
|
402 |
|
|
drawn with angled corners that cut in 4 pixels from the edge of the tab.
|
403 |
|
|
The default is 0. This is generally only set at the tabnotebook level.
|
404 |
|
|
Tabs normally will want to share the same bevelAmount.
|
405 |
|
|
.TP
|
406 |
|
|
\fB-bitmap\fR \fIvalue\fR
|
407 |
|
|
If label is a non-empty string, specifies a bitmap to display in this
|
408 |
|
|
page's tab. Bitmap may be of any of the forms accepted by Tk_GetPixmap.
|
409 |
|
|
.TP
|
410 |
|
|
\fB-command\fR \fIvalue\fR
|
411 |
|
|
Specifies a Tcl command to be executed when this page is selected. This
|
412 |
|
|
allows the programmer a hook to reconfigure this page's widgets or any
|
413 |
|
|
other page's widgets.
|
414 |
|
|
.IP
|
415 |
|
|
If the tabnotebook has the auto option set to true, when a page is
|
416 |
|
|
selected this command will be called immediately after the previously
|
417 |
|
|
selected page is unpacked and immediately before this page is selected. The
|
418 |
|
|
index value select is valid during this Tcl command. `index select' will
|
419 |
|
|
return this page's page number.
|
420 |
|
|
.IP
|
421 |
|
|
If the auto option is set to false, when a page is selected the unpack
|
422 |
|
|
and pack calls are bypassed. This Tcl command is still called.
|
423 |
|
|
.TP
|
424 |
|
|
\fB-disabledforeground\fR \fIvalue\fR
|
425 |
|
|
Specifies a foreground color to use for displaying tab labels when tabs
|
426 |
|
|
are in their disable state. If this option is specified as an empty
|
427 |
|
|
string (the default), then the disabledforeground option for the overall
|
428 |
|
|
tabnotebook is used.
|
429 |
|
|
.TP
|
430 |
|
|
\fB-font\fR \fIvalue\fR
|
431 |
|
|
Specifies the font to use when drawing a text label on a page tab. If
|
432 |
|
|
this option is specified as an empty string then the font option for the
|
433 |
|
|
overall tabnotebook is used..
|
434 |
|
|
.TP
|
435 |
|
|
\fB-foreground\fR \fIvalue\fR
|
436 |
|
|
Specifies a foreground color to use for displaying tab labels when they are
|
437 |
|
|
selected. If this option is specified as an empty string (the default),
|
438 |
|
|
then the foreground option for the overall tabnotebook is used.
|
439 |
|
|
.TP
|
440 |
|
|
\fB-label\fR \fIvalue\fR
|
441 |
|
|
Specifies a string to display as an identifying label for a notebook
|
442 |
|
|
page. This label serves as an additional identifier used to reference the
|
443 |
|
|
page. This label may be used for the index value in widget commands.
|
444 |
|
|
.TP
|
445 |
|
|
\fB-tabbackground\fR \fIvalue\fR
|
446 |
|
|
Specifies a background color to use for displaying a tab when it is not
|
447 |
|
|
elected. If this option is specified as an empty string (the default), then
|
448 |
|
|
the tabBackground option for the overall tabnotebook is used.
|
449 |
|
|
.TP
|
450 |
|
|
\fB-tabforeground\fR \fIvalue\fR
|
451 |
|
|
Specifies a foreground color to use for displaying the tab's text label
|
452 |
|
|
when it is not selected. If this option is specified as an empty
|
453 |
|
|
string (the default), then the tabForeground option for the overall
|
454 |
|
|
tabnotebook is used.
|
455 |
|
|
.TP
|
456 |
|
|
\fB-padx\fR \fIvalue\fR
|
457 |
|
|
Specifies a non-negative value indicating how much extra space to request
|
458 |
|
|
for a tab around its label in the X-direction. When computing how large a
|
459 |
|
|
window it needs, the tab will add this amount to the width it would
|
460 |
|
|
normally need The tab will end up with extra internal space to the
|
461 |
|
|
left and right of its text label. This value may have any of the forms
|
462 |
|
|
acceptable to Tk_GetPixels. If this option is specified as an empty
|
463 |
|
|
string (the default), then the padX option for the overall tabnotebook is used
|
464 |
|
|
.TP
|
465 |
|
|
\fB-pady\fR \fIvalue\fR
|
466 |
|
|
Specifies a non-negative value indicating how much extra space to request
|
467 |
|
|
for a tab around its label in the Y-direction. When computing how large
|
468 |
|
|
a window it needs, the tab will add this amount to the height it would
|
469 |
|
|
normally need The tab will end up with extra internal space to the top and
|
470 |
|
|
bottom of its text label. This value may have any of the forms acceptable
|
471 |
|
|
to Tk_GetPixels. If this option is specified as an empty string (the
|
472 |
|
|
default), then the padY option for the overall tabnotebook is used
|
473 |
|
|
.TP
|
474 |
|
|
\fB-state\fR \fIvalue\fR
|
475 |
|
|
Specifies one of two states for the page: normal or disabled. In normal state
|
476 |
|
|
unselected tabs are displayed using the tabforeground and tabbackground
|
477 |
|
|
option from the tabnotebook or the page. Selected tabs and pages are
|
478 |
|
|
displayed using the foreground and background option from the tabnotebook or
|
479 |
|
|
the page. The disabled state means that the page and its tab is
|
480 |
|
|
insensitive: it doesn't respond to mouse button presses or releases. In this
|
481 |
|
|
state the entry is displayed according to its disabledForeground option for
|
482 |
|
|
the tabnotebook and the background/tabbackground option from the page or
|
483 |
|
|
the tabnotebook.
|
484 |
|
|
.RE
|
485 |
|
|
.TP
|
486 |
|
|
'>>>>>>>>>>
|
487 |
|
|
\fIpathName\fR \fBchildSite\fR ?\fIindex\fR?
|
488 |
|
|
If passed no arguments, returns a list of pathNames for all the pages
|
489 |
|
|
in the tabnotebook. If the tab notebook is empty, an empty list is returned
|
490 |
|
|
.IP
|
491 |
|
|
If \fIindex\fR is passed, it returns the \fIpathName\fR for the page's
|
492 |
|
|
child site \fBframe\fR specified by \fIindex\fR. Widgets that are created
|
493 |
|
|
with this \fIpathName\fR will be displayed when the associated page is
|
494 |
|
|
selected. If \fIindex\fR is not a valid index, an empty string is returned.
|
495 |
|
|
.TP
|
496 |
|
|
\fIpathName\fR \fBconfigure\fR ?\fIoption\fR? ?\fIvalue\fR \fIoption\fR \fIvalue\fR ...?
|
497 |
|
|
Query or modify the configuration options of the widget. If no \fIoption\fR
|
498 |
|
|
is specified, returns a list describing all of the available options
|
499 |
|
|
for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the
|
500 |
|
|
format of this list). If option is specified with no value, then the
|
501 |
|
|
command returns a list describing the one named option (this list will be
|
502 |
|
|
identical to the corresponding sublist of the value returned if no option
|
503 |
|
|
is specified). If one or more option-value pairs are specified, then the
|
504 |
|
|
command modifies the given widget option(s) to have the given value(s); in
|
505 |
|
|
this case the command returns an empty string. \fIOption\fR may have any
|
506 |
|
|
of the values accepted by the tabnotebook command.
|
507 |
|
|
.TP
|
508 |
|
|
\fIpathName\fR \fBdelete\fR \fIindex1\fR ?\fIindex2\fR?
|
509 |
|
|
Delete all of the pages between \fIindex1\fR and \fIindex2\fR inclusive.
|
510 |
|
|
If \fIindex2\fR is omitted then it defaults to \fIindex1\fR. Returns an
|
511 |
|
|
empty string.
|
512 |
|
|
.TP
|
513 |
|
|
\fIpathName\fR \fBindex\fR \fIindex\fR
|
514 |
|
|
Returns the numerical index corresponding to \fIindex\fR.
|
515 |
|
|
.TP
|
516 |
|
|
\fIpathName\fR \fBinsert\fR \fIindex\fR ?\fIoption\fR \fIvalue\fR \fIoption\fR \fIvalue\fR ...?
|
517 |
|
|
Insert a new page in the tabnotebook before the page specified
|
518 |
|
|
by \fIindex\fR. A new child site \fBframe\fR is created. The additional
|
519 |
|
|
arguments are the same as for the \fBadd\fR command. Returns the
|
520 |
|
|
child site \fIpathName\fR.
|
521 |
|
|
.TP
|
522 |
|
|
\fIpathName\fR \fBnext\fR
|
523 |
|
|
Advances the selected page to the next page (order is determined by
|
524 |
|
|
insertion order). If the currently selected page is the last page in
|
525 |
|
|
the notebook, the selection wraps around to the first page in the
|
526 |
|
|
notebook. It behaves as if the user selected the new page.
|
527 |
|
|
.IP
|
528 |
|
|
For notebooks with \fBauto\fR set to \fBtrue\fR the current page's
|
529 |
|
|
child site is unpacked from the notebook's child site frame. Then the next
|
530 |
|
|
page's child site is packed into the notebook's child site frame. The
|
531 |
|
|
Tcl command given with the command option will be invoked between these
|
532 |
|
|
two operations.
|
533 |
|
|
.IP
|
534 |
|
|
For notebooks with \fBauto\fR set to \fBfalse\fR the Tcl command given
|
535 |
|
|
with the command option will be invoked.
|
536 |
|
|
.TP
|
537 |
|
|
\fIpathName\fR \fBpageconfigure\fR \fIindex\fR ?\fIoption\fR? ?\fIvalue\fR \fIoption\fR \fIvalue\fR ...?
|
538 |
|
|
This command is similar to the \fBconfigure\fR command, except that it
|
539 |
|
|
applies to the options for an individual page, whereas configure applies
|
540 |
|
|
to the options for the tabnotebook as a whole. \fIOptions\fR may have
|
541 |
|
|
any of the values accepted by the add widget command. If options are
|
542 |
|
|
specified, options are modified as indicated in the command and the
|
543 |
|
|
command returns an empty string. If no options are specified, returns a
|
544 |
|
|
list describing the current options for page index (see \fBTk_ConfigureInfo\fR
|
545 |
|
|
for information on the format of this list).
|
546 |
|
|
.TP
|
547 |
|
|
\fIpathName\fR \fBprev\fR
|
548 |
|
|
Moves the selected page to the previous page (order is determined by
|
549 |
|
|
insertion order). If the currently selected page is the first page in
|
550 |
|
|
the notebook, the selection wraps around to the last page in the notebook. It
|
551 |
|
|
behaves as if the user selected the new page.
|
552 |
|
|
.IP
|
553 |
|
|
For notebooks with \fBauto\fR set to \fBtrue\fR the current page's
|
554 |
|
|
child site is unpacked from the notebook's child site \fBframe\fR. Then the
|
555 |
|
|
previous page's child site is packed into the notebook's child site frame.
|
556 |
|
|
The Tcl command given with the command option will be invoked between these
|
557 |
|
|
two operations.
|
558 |
|
|
.IP
|
559 |
|
|
For notebooks with \fBauto\fR set to \fBfalse\fR the Tcl command given
|
560 |
|
|
with the command option will be invoked.
|
561 |
|
|
.TP
|
562 |
|
|
\fIpathName\fR \fBselect\fR \fIindex\fR
|
563 |
|
|
Selects the page specified by \fIindex\fR as the currently selected page.
|
564 |
|
|
It behaves as if the user selected the new page.
|
565 |
|
|
.IP
|
566 |
|
|
For notebooks with \fBauto\fR set to \fBtrue\fR the current page's child
|
567 |
|
|
site is unpacked from the notebook's child site frame. Then the \fIindex\fR
|
568 |
|
|
page's child site is packed into the notebook's child site frame. The
|
569 |
|
|
Tcl command given with the command option will be invoked between these two
|
570 |
|
|
operations.
|
571 |
|
|
.IP
|
572 |
|
|
For notebooks with \fBauto\fR set to \fBfalse\fR the Tcl command given
|
573 |
|
|
with the command option will be invoked.
|
574 |
|
|
.TP
|
575 |
|
|
\fIpathName\fR \fBview\fR
|
576 |
|
|
Returns the currently selected page. This command is for compatibility with
|
577 |
|
|
the \fBscrollbar\fR widget.
|
578 |
|
|
.TP
|
579 |
|
|
\fIpathName\fR \fBview\fR \fIindex\fR
|
580 |
|
|
Selects the page specified by \fIindex\fR as the currently selected page.
|
581 |
|
|
This command is for compatibility with the \fBscrollbar\fR widget.
|
582 |
|
|
.TP
|
583 |
|
|
\fIpathName\fR \fBview\fR \fBmoveto\fR \fIfraction\fR
|
584 |
|
|
Uses the \fIfraction\fR value to determine the corresponding page to move to.
|
585 |
|
|
This command is for compatibility with the \fBscrollbar\fR widget.
|
586 |
|
|
.TP
|
587 |
|
|
\fIpathName\fR \fBview\fR \fBscroll\fR \fInum\fR \fIwhat\fR
|
588 |
|
|
Uses the \fInum\fR value to determine how many pages to move forward or
|
589 |
|
|
backward (\fInum\fR can be negative or positive). The \fIwhat\fR argument
|
590 |
|
|
is ignored. This command is for compatibility with the \fBscrollbar\fR widget.
|
591 |
|
|
.SH "COMPONENTS"
|
592 |
|
|
.LP
|
593 |
|
|
Generally all behavior of the internal components, \fBtabset\fR
|
594 |
|
|
and \fBnotebook\fR are controlled via the \fBpageconfigure\fR method.
|
595 |
|
|
The following section documents these two components.
|
596 |
|
|
.LP
|
597 |
|
|
.nf
|
598 |
|
|
Name: \fBtabset\fR
|
599 |
|
|
Class: \fBTabset\fR
|
600 |
|
|
.fi
|
601 |
|
|
.IP
|
602 |
|
|
This is the tabset component. It implements the tabs that are associated
|
603 |
|
|
with the notebook component.
|
604 |
|
|
.IP
|
605 |
|
|
See the "\fBTabset\fR" widget manual entry for details on
|
606 |
|
|
the \fBtabset\fR component item.
|
607 |
|
|
.LP
|
608 |
|
|
.nf
|
609 |
|
|
Name: \fBnotebook\fR
|
610 |
|
|
Class: \fBNotebook\fR
|
611 |
|
|
.fi
|
612 |
|
|
.IP
|
613 |
|
|
This is the notebook component. It implements the notebook that contains the
|
614 |
|
|
pages of the tabnotebook.
|
615 |
|
|
.IP
|
616 |
|
|
See the "\fBNotebook\fR" widget manual entry for details on
|
617 |
|
|
the \fBnotebook\fR component item.
|
618 |
|
|
.fi
|
619 |
|
|
.SH EXAMPLE
|
620 |
|
|
.PP
|
621 |
|
|
Following is an example that creates a tabnotebook with two pages.
|
622 |
|
|
.PP
|
623 |
|
|
.nf
|
624 |
|
|
.IP
|
625 |
|
|
.ta 2c 8c 12c
|
626 |
|
|
# Create the tabnotebook widget and pack it.
|
627 |
|
|
tabnotebook .tn -width 100 -height 100
|
628 |
|
|
pack .tn \\
|
629 |
|
|
-anchor nw \\
|
630 |
|
|
-fill both \\
|
631 |
|
|
-expand yes \\
|
632 |
|
|
-side left \\
|
633 |
|
|
-padx 10 \\
|
634 |
|
|
-pady 10
|
635 |
|
|
.IP
|
636 |
|
|
# Add two pages to the tabnotebook,
|
637 |
|
|
# labelled "Page One" and "Page Two"
|
638 |
|
|
.tn add -label "Page One"
|
639 |
|
|
.tn add -label "Page Two"
|
640 |
|
|
.IP
|
641 |
|
|
# Get the child site frames of these two pages.
|
642 |
|
|
set page1CS [.tn childsite 0]
|
643 |
|
|
set page2CS [.tn childsite "Page Two"]
|
644 |
|
|
.IP
|
645 |
|
|
# Create buttons on each page of the tabnotebook.
|
646 |
|
|
button $page1CS.b -text "Button One"
|
647 |
|
|
pack $page1CS.b
|
648 |
|
|
button $page2CS.b -text "Button Two"
|
649 |
|
|
pack $page2CS.b
|
650 |
|
|
.IP
|
651 |
|
|
# Select the first page of the tabnotebook.
|
652 |
|
|
.tn select 0
|
653 |
|
|
.fi
|
654 |
|
|
.SH AUTHOR
|
655 |
|
|
Bill W. Scott
|
656 |
|
|
.SH KEYWORDS
|
657 |
|
|
tab tabset notebook tabnotebook page
|