1 |
578 |
markom |
<HTML>
|
2 |
|
|
<HEAD>
|
3 |
|
|
<TITLE>iwidgets2.2.0 User Commands - tabnotebook</TITLE>
|
4 |
|
|
</HEAD>
|
5 |
|
|
<BODY BGCOLOR="#FFFFFF">
|
6 |
|
|
<H1>iwidgets2.2.0 User Commands - tabnotebook</H1>
|
7 |
|
|
<HR>
|
8 |
|
|
<PRE>
|
9 |
|
|
|
10 |
|
|
</PRE>
|
11 |
|
|
<H2><HR ALIGN=LEFT WIDTH=70% SIZE=3></H2><PRE>
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
</PRE>
|
15 |
|
|
<H2>NAME</H2><PRE>
|
16 |
|
|
tabnotebook - create and manipulate tabnotebook widgets
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
</PRE>
|
20 |
|
|
<H2>SYNOPSIS</H2><PRE>
|
21 |
|
|
<STRONG>tabnotebook</STRONG> <EM>pathName</EM>? <EM>options</EM>?
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
</PRE>
|
25 |
|
|
<H2>INHERITANCE</H2><PRE>
|
26 |
|
|
itk::Widget <- tabnotebook
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
</PRE>
|
30 |
|
|
<H2>STANDARD OPTIONS</H2><PRE>
|
31 |
|
|
<STRONG>background</STRONG> <STRONG>disabledForeground</STRONG> <STRONG>foregroundscrollCommand</STRONG>
|
32 |
|
|
<STRONG>cursor</STRONG> <STRONG>font</STRONG> <STRONG>height</STRONG> <STRONG>width</STRONG>
|
33 |
|
|
|
34 |
|
|
See the "options" manual entry for details on the standard
|
35 |
|
|
options.
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
</PRE>
|
39 |
|
|
<H2>WIDGET-SPECIFIC OPTIONS</H2><PRE>
|
40 |
|
|
Name: <STRONG>angle</STRONG>
|
41 |
|
|
Class: <STRONG>Angle</STRONG>
|
42 |
|
|
Command-Line Switch: <STRONG>-angle</STRONG>
|
43 |
|
|
|
44 |
|
|
Specifes the angle of slope from the inner edge to the
|
45 |
|
|
outer edge of the tab. An angle of 0 specifies square
|
46 |
|
|
tabs. Valid ranges are 0 to 45 degrees inclusive.
|
47 |
|
|
Default is 15 degrees. If <STRONG>tabPos</STRONG> is e or w, this option
|
48 |
|
|
is ignored.
|
49 |
|
|
|
50 |
|
|
Name: <STRONG>auto</STRONG>
|
51 |
|
|
Class: <STRONG>Auto</STRONG>
|
52 |
|
|
Command-Line Switch: <STRONG>-auto</STRONG>
|
53 |
|
|
|
54 |
|
|
Specifies whether to use the automatic
|
55 |
|
|
packing/unpacking algorithm of the notebook. A value of
|
56 |
|
|
true indicates that page frames will be unpacked and
|
57 |
|
|
packed acoording to the algorithm described in the
|
58 |
|
|
select command. A value of <STRONG>false</STRONG> leaves the current
|
59 |
|
|
page packed and subsequent <STRONG>selects</STRONG>, <STRONG>next</STRONG>, or <STRONG>previous</STRONG>
|
60 |
|
|
commands do not switch pages automatically. In either
|
61 |
|
|
case the page's associated command (see the <STRONG>add</STRONG>
|
62 |
|
|
command's description of the command option) is
|
63 |
|
|
invoked. The value may have any of the forms accepted
|
64 |
|
|
by the <STRONG>Tcl_GetBoolean</STRONG>, such as <STRONG>true</STRONG>, <STRONG>false</STRONG>, <STRONG>0</STRONG>, <STRONG>1</STRONG>, <STRONG>yes</STRONG>,
|
65 |
|
|
or <STRONG>no</STRONG>.
|
66 |
|
|
|
67 |
|
|
Name: <STRONG>backdrop</STRONG>
|
68 |
|
|
Class: <STRONG>Backdrop</STRONG>
|
69 |
|
|
Command-Line Switch: <STRONG>-backdrop</STRONG>
|
70 |
|
|
|
71 |
|
|
Specifies a background color to use when filling in the
|
72 |
|
|
backdrop area behind the tabs.
|
73 |
|
|
|
74 |
|
|
Name: <STRONG>background</STRONG>
|
75 |
|
|
Class: <STRONG>Background</STRONG>
|
76 |
|
|
Command-Line Switch: <STRONG>-background</STRONG>
|
77 |
|
|
|
78 |
|
|
Specifies a background color to use for displaying a
|
79 |
|
|
page and its associated tab. This can be thought of as
|
80 |
|
|
the selected tab background color, since the tab asso-
|
81 |
|
|
ciated with the selected page is the selected tab.
|
82 |
|
|
|
83 |
|
|
Name: <STRONG>bevelAmount</STRONG>
|
84 |
|
|
Class: <STRONG>BevelAmount</STRONG>
|
85 |
|
|
Command-Line Switch: <STRONG>-bevelamount</STRONG>
|
86 |
|
|
|
87 |
|
|
Specifes the size of tab corners. A value of 0 with
|
88 |
|
|
<STRONG>angle</STRONG> set to 0 results in square tabs. A <STRONG>bevelAmount</STRONG> of
|
89 |
|
|
4, means that the tab will be drawn with angled corners
|
90 |
|
|
that cut in 4 pixels from the edge of the tab. The
|
91 |
|
|
default is 0.
|
92 |
|
|
|
93 |
|
|
Name: <STRONG>borderWidth</STRONG>
|
94 |
|
|
Class: <STRONG>BorderWidth</STRONG>
|
95 |
|
|
Command-Line Switch: <STRONG>-borderwidth</STRONG>
|
96 |
|
|
|
97 |
|
|
Specifies the width of shadowed border to place around
|
98 |
|
|
the notebook area of the tabnotebook. The default value
|
99 |
|
|
is 2.
|
100 |
|
|
|
101 |
|
|
Name: <STRONG>disabledForeground</STRONG>
|
102 |
|
|
Class: <STRONG>DisabledForeground</STRONG>
|
103 |
|
|
Command-Line Switch: <STRONG>-disabledforeground</STRONG>
|
104 |
|
|
|
105 |
|
|
Specifies a foreground color to use for displaying a
|
106 |
|
|
tab's label when its <STRONG>state</STRONG> is disabled.
|
107 |
|
|
|
108 |
|
|
Name: <STRONG>equalTabs</STRONG>
|
109 |
|
|
Class: <STRONG>EqualTabs</STRONG>
|
110 |
|
|
Command-Line Switch: <STRONG>-equaltabs</STRONG>
|
111 |
|
|
|
112 |
|
|
Specifies whether to force tabs to be equal sized or
|
113 |
|
|
not. A value of <STRONG>true</STRONG> means constrain tabs to be equal
|
114 |
|
|
sized. A value of <STRONG>false</STRONG> allows each tab to size based
|
115 |
|
|
on the text label size. The value may have any of the
|
116 |
|
|
forms accepted by the <STRONG>Tcl_GetBoolean</STRONG>, such as <STRONG>true</STRONG>,
|
117 |
|
|
<STRONG>false</STRONG>, <STRONG>0</STRONG>, <STRONG>1</STRONG>, <STRONG>yes</STRONG>, or <STRONG>no</STRONG>.
|
118 |
|
|
|
119 |
|
|
For horizontally positioned tabs (<STRONG>tabpos</STRONG> is either <STRONG>s</STRONG> or
|
120 |
|
|
<STRONG>n</STRONG>), <STRONG>true</STRONG> forces all tabs to be equal width (the width
|
121 |
|
|
being equal to the longest label plus any <STRONG>padX</STRONG> speci-
|
122 |
|
|
fied). Horizontal tabs are always equal in height.
|
123 |
|
|
|
124 |
|
|
For vertically positioned tabs (<STRONG>tabpos</STRONG> is either <STRONG>w</STRONG> or
|
125 |
|
|
<STRONG>e</STRONG>), <STRONG>true</STRONG> forces all tabs to be equal height (the height
|
126 |
|
|
being equal to the height of the label with the largest
|
127 |
|
|
font). Vertically oriented tabs are always equal in
|
128 |
|
|
width.
|
129 |
|
|
|
130 |
|
|
Name: <STRONG>foreground</STRONG>
|
131 |
|
|
Class: <STRONG>Foreground</STRONG>
|
132 |
|
|
Command-Line Switch: <STRONG>-foreground</STRONG>
|
133 |
|
|
|
134 |
|
|
Specifies a foreground color to use for displaying a
|
135 |
|
|
page and its associated tab label. This can be thought
|
136 |
|
|
of as the selected tab background color, since the tab
|
137 |
|
|
associated with the selected page is the selected tab.
|
138 |
|
|
|
139 |
|
|
Name: <STRONG>gap</STRONG>
|
140 |
|
|
Class: <STRONG>Gap</STRONG>
|
141 |
|
|
Command-Line Switch: <STRONG>-gap</STRONG>
|
142 |
|
|
|
143 |
|
|
Specifies the amount of pixel space to place between
|
144 |
|
|
each tab. Value may be any pixel offset value. In addi-
|
145 |
|
|
tion, a special keyword <STRONG>overlap</STRONG> can be used as the
|
146 |
|
|
value to achieve a standard overlap of tabs. This value
|
147 |
|
|
may have any of the forms acceptable to <STRONG>Tk_GetPixels</STRONG>.
|
148 |
|
|
|
149 |
|
|
Name: <STRONG>margin</STRONG>
|
150 |
|
|
Class: <STRONG>Margin</STRONG>
|
151 |
|
|
Command-Line Switch: <STRONG>-Bmargin</STRONG>
|
152 |
|
|
|
153 |
|
|
Specifies the amount of space to place between the out-
|
154 |
|
|
side edge of the tabnotebook and the outside edge of
|
155 |
|
|
its tabs. If <STRONG>tabPos</STRONG> is <STRONG>s</STRONG>, this is the amount of space
|
156 |
|
|
between the bottom edge of the tabnotebook and the bot-
|
157 |
|
|
tom edge of the set of tabs. If <STRONG>tabPos</STRONG> is <STRONG>n</STRONG>, this is
|
158 |
|
|
the amount of space between the top edge of the tab-
|
159 |
|
|
notebook and the top edge of the set of tabs. If <STRONG>tabPos</STRONG>
|
160 |
|
|
is <STRONG>e</STRONG>, this is the amount of space between the right
|
161 |
|
|
edge of the tabnotebook and the right edge of the set
|
162 |
|
|
of tabs. If <STRONG>tabPos</STRONG> is <STRONG>w</STRONG>, this is the amount of space
|
163 |
|
|
between the left edge of the tabnotebook and the left
|
164 |
|
|
edge of the set of tabs. This value may have any of the
|
165 |
|
|
forms acceptable to <STRONG>Tk_GetPixels</STRONG>.
|
166 |
|
|
|
167 |
|
|
Name: <STRONG>padX</STRONG>
|
168 |
|
|
Class: <STRONG>PadX</STRONG>
|
169 |
|
|
Command-Line Switch: <STRONG>-padx</STRONG>
|
170 |
|
|
|
171 |
|
|
Specifies a non-negative value indicating how much
|
172 |
|
|
extra space to request for a tab around its label in
|
173 |
|
|
the X-direction. When computing how large a window it
|
174 |
|
|
needs, the tab will add this amount to the width it
|
175 |
|
|
would normally need The tab will end up with extra
|
176 |
|
|
internal space to the left and right of its text label.
|
177 |
|
|
This value may have any of the forms acceptable to
|
178 |
|
|
<STRONG>Tk_GetPixels</STRONG>.
|
179 |
|
|
|
180 |
|
|
Name: <STRONG>padY</STRONG>
|
181 |
|
|
Class: <STRONG>PadY</STRONG>
|
182 |
|
|
Command-Line Switch: <STRONG>-pady</STRONG>
|
183 |
|
|
|
184 |
|
|
Specifies a non-negative value indicating how much
|
185 |
|
|
extra space to request for a tab around its label in
|
186 |
|
|
the Y-direction. When computing how large a window it
|
187 |
|
|
needs, the tab will add this amount to the height it
|
188 |
|
|
would normally need The tab will end up with extra
|
189 |
|
|
internal space to the top and bottom of its text label.
|
190 |
|
|
This value may have any of the forms acceptable to
|
191 |
|
|
<STRONG>Tk_GetPixels</STRONG>.
|
192 |
|
|
|
193 |
|
|
Name: <STRONG>raiseSelect</STRONG>
|
194 |
|
|
Class: <STRONG>RaiseSelect</STRONG>
|
195 |
|
|
Command-Line Switch: <STRONG>-raiseselect</STRONG>
|
196 |
|
|
|
197 |
|
|
Specifes whether to slightly raise the selected tab
|
198 |
|
|
from the rest of the tabs. The selected tab is drawn 2
|
199 |
|
|
pixels closer to the outside of the tabnotebook than
|
200 |
|
|
the unselected tabs. A value of <STRONG>true</STRONG> says to raise
|
201 |
|
|
selected tabs, a value of <STRONG>false</STRONG> turns this feature off.
|
202 |
|
|
The default is <STRONG>false</STRONG>. The value may have any of the
|
203 |
|
|
forms accepted by the <STRONG>Tcl_GetBoolean</STRONG>, such as <STRONG>true</STRONG>,
|
204 |
|
|
<STRONG>false</STRONG>, <STRONG>0</STRONG>, <STRONG>1</STRONG>, <STRONG>yes</STRONG>, or <STRONG>no</STRONG>.
|
205 |
|
|
|
206 |
|
|
Name: <STRONG>start</STRONG>
|
207 |
|
|
Class: <STRONG>Start</STRONG>
|
208 |
|
|
Command-Line Switch: <STRONG>-start</STRONG>
|
209 |
|
|
|
210 |
|
|
Specifies the amount of space to place between the left
|
211 |
|
|
or top edge of the tabnotebook and the starting edge of
|
212 |
|
|
its tabs. For horizontally positioned tabs, this is the
|
213 |
|
|
amount of space between the left edge of the notebook
|
214 |
|
|
and the left edge of the first tab. For vertically
|
215 |
|
|
positioned tabs, this is the amount of space between
|
216 |
|
|
the top of the notebook and the top of the first tab.
|
217 |
|
|
This value may change if the user performs a MButton-2
|
218 |
|
|
scroll on the tabs. This value may have any of the
|
219 |
|
|
forms acceptable to <STRONG>Tk_GetPixels</STRONG>.
|
220 |
|
|
|
221 |
|
|
Name: <STRONG>state</STRONG>
|
222 |
|
|
Class: <STRONG>State</STRONG>
|
223 |
|
|
Command-Line Switch: <STRONG>-state</STRONG>
|
224 |
|
|
|
225 |
|
|
Sets the active state of the tabnotebook. Specifying
|
226 |
|
|
<STRONG>normal</STRONG> allows all pages to be selectable. Specifying
|
227 |
|
|
<STRONG>disabled</STRONG> disables the notebook causing all page tabs to
|
228 |
|
|
be drawn in the <STRONG>disabledForeground</STRONG> color.
|
229 |
|
|
|
230 |
|
|
Name: <STRONG>tabBackground</STRONG>
|
231 |
|
|
Class: <STRONG>TabBackground</STRONG>
|
232 |
|
|
Command-Line Switch: <STRONG>-tabbackground</STRONG>
|
233 |
|
|
|
234 |
|
|
Specifies a background color to use for displaying tab
|
235 |
|
|
backgrounds when they are in their unselected state.
|
236 |
|
|
This is the background associated with tabs on all
|
237 |
|
|
pages other than the selected page.
|
238 |
|
|
|
239 |
|
|
Name: <STRONG>tabBorders</STRONG>
|
240 |
|
|
Class: <STRONG>TabBorders</STRONG>
|
241 |
|
|
Command-Line Switch: <STRONG>-tabborders</STRONG>
|
242 |
|
|
|
243 |
|
|
Specifies whether to draw the borders of tabs that are
|
244 |
|
|
not selected. Specifying <STRONG>true</STRONG> (the default) draws these
|
245 |
|
|
borders, specifying <STRONG>false</STRONG> draws only the border around
|
246 |
|
|
the selected tab. The value may have any of the forms
|
247 |
|
|
accepted by the <STRONG>Tcl_GetBoolean</STRONG>, such as <STRONG>true</STRONG>, <STRONG>false</STRONG>, <STRONG>0</STRONG>,
|
248 |
|
|
<STRONG>1</STRONG>, <STRONG>yes</STRONG>, or <STRONG>no</STRONG>.
|
249 |
|
|
|
250 |
|
|
Name: <STRONG>tabForeground</STRONG>
|
251 |
|
|
Class: <STRONG>TabForeground</STRONG>
|
252 |
|
|
Command-Line Switch: <STRONG>-tabforeground</STRONG>
|
253 |
|
|
|
254 |
|
|
Specifies a foreground color to use for displaying tab
|
255 |
|
|
labels when they are in their unselected state. This is
|
256 |
|
|
the foreground associated with tabs on all pages other
|
257 |
|
|
than the selected page.
|
258 |
|
|
|
259 |
|
|
Name: <STRONG>tabPos</STRONG>
|
260 |
|
|
Class: <STRONG>TabPos</STRONG>
|
261 |
|
|
Command-Line Switch: <STRONG>-tabpos</STRONG>
|
262 |
|
|
|
263 |
|
|
Specifies the location of the set of tabs in relation
|
264 |
|
|
to the notebook area. Must be n, s, e, or w. Defaults
|
265 |
|
|
to s.
|
266 |
|
|
|
267 |
|
|
</PRE>
|
268 |
|
|
<H2><HR ALIGN=LEFT WIDTH=70% SIZE=3></H2><PRE>
|
269 |
|
|
|
270 |
|
|
|
271 |
|
|
</PRE>
|
272 |
|
|
<H2>DESCRIPTION</H2><PRE>
|
273 |
|
|
The <STRONG>tabnotebook</STRONG> command creates a new window (given by the
|
274 |
|
|
pathName argument) and makes it into a <STRONG>tabnotebook</STRONG> widget.
|
275 |
|
|
Additional options, described above may be specified on the
|
276 |
|
|
command line or in the option database to configure aspects
|
277 |
|
|
of the tabnotebook such as its colors, font, and text. The
|
278 |
|
|
tabnotebook command returns its pathName argument. At the
|
279 |
|
|
time this command is invoked, there must not exist a window
|
280 |
|
|
named pathName, but pathName's parent must exist.
|
281 |
|
|
|
282 |
|
|
A <STRONG>tabnotebook</STRONG> is a widget that contains a set of tabbed
|
283 |
|
|
pages. It displays one page from the set as the selected
|
284 |
|
|
page. A Tab displays the label for the page to which it is
|
285 |
|
|
attached and serves as a page selector. When a page's tab is
|
286 |
|
|
selected, the page's contents are displayed in the page
|
287 |
|
|
area. The selected tab has a three-dimensional effect to
|
288 |
|
|
make it appear to float above the other tabs. The tabs are
|
289 |
|
|
displayed as a group along either the left, top, right, or
|
290 |
|
|
bottom edge. When first created a tabnotebook has no pages.
|
291 |
|
|
Pages may be added or deleted using widget commands
|
292 |
|
|
described below.
|
293 |
|
|
|
294 |
|
|
A special option may be provided to the tabnotebook. The
|
295 |
|
|
<STRONG>-auto</STRONG> option specifies whether the tabnotebook will automat-
|
296 |
|
|
ically handle the unpacking and packing of pages when pages
|
297 |
|
|
are selected. A value of true signifies that the notebook
|
298 |
|
|
will automatically manage it. This is the default value. A
|
299 |
|
|
value of false signifies the notebook will not perform
|
300 |
|
|
automatic switching of pages.
|
301 |
|
|
|
302 |
|
|
|
303 |
|
|
</PRE>
|
304 |
|
|
<H2>NOTEBOOK PAGES</H2><PRE>
|
305 |
|
|
A tabnotebook's pages area contains a single child site
|
306 |
|
|
frame. When a new page is created it is a child of this
|
307 |
|
|
frame. The page's child site frame serves as a geometry con-
|
308 |
|
|
tainer for applications to pack widgets into. It is this
|
309 |
|
|
frame that is automatically unpacked or packed when the auto
|
310 |
|
|
option is true. This creates the effect of one page being
|
311 |
|
|
visible at a time. When a new page is selected, the previ-
|
312 |
|
|
ously selected page's child site frame is automatically
|
313 |
|
|
unpacked from the tabnotebook's child site frame and the
|
314 |
|
|
newly selected page's child site is packed into the
|
315 |
|
|
tabnotebook's child site frame.
|
316 |
|
|
|
317 |
|
|
However, sometimes it is desirable to handle page changes in
|
318 |
|
|
a different manner. By specifying the <STRONG>auto</STRONG> option as <STRONG>false</STRONG>,
|
319 |
|
|
child site packing can be disabled and done differently. For
|
320 |
|
|
example, all widgets might be packed into the first page's
|
321 |
|
|
child site <STRONG>frame</STRONG>. Then when a new page is selected, the
|
322 |
|
|
application can reconfigure the widgets and give the appear-
|
323 |
|
|
ance that the page was flipped.
|
324 |
|
|
|
325 |
|
|
In both cases the command option for a page specifies a Tcl
|
326 |
|
|
Command to execute when the page is selected. In the case of
|
327 |
|
|
<STRONG>auto</STRONG> being <STRONG>true</STRONG>, it is between the unpacking of the previ-
|
328 |
|
|
ously selected page and the packing of the newly selected
|
329 |
|
|
page.
|
330 |
|
|
|
331 |
|
|
Notebook pages can also be controlled with scroll bars or
|
332 |
|
|
other widgets that obey the <STRONG>scrollcommand</STRONG> protocol. By giv-
|
333 |
|
|
ing a scrollbar a <STRONG>-command</STRONG> to call the tabnotebook's <STRONG>select</STRONG>
|
334 |
|
|
method, the tabnotebook can be controlled with a scrollbar.
|
335 |
|
|
|
336 |
|
|
The notebook area is implemented with the notebook mega
|
337 |
|
|
widget.
|
338 |
|
|
|
339 |
|
|
|
340 |
|
|
|
341 |
|
|
</PRE>
|
342 |
|
|
<H2>TABS</H2><PRE>
|
343 |
|
|
Tabs appear along the edge of the notebook area. Tabs are
|
344 |
|
|
drawn to appear attached to their associated page. When a
|
345 |
|
|
tab is clicked on, the associated page is selected and the
|
346 |
|
|
tab is drawn as raised above all other tabs and as a seam-
|
347 |
|
|
less part of its notebook page. Tabs can be controlled in
|
348 |
|
|
their location along the edges, the angle tab sides are
|
349 |
|
|
drawn with, gap between tabs, starting margin of tabs,
|
350 |
|
|
internal padding around text labels in a tab, the font, and
|
351 |
|
|
its label.
|
352 |
|
|
|
353 |
|
|
The Tab area is implemented with the <STRONG>tabset</STRONG> mega widget. See
|
354 |
|
|
<STRONG>tabset(1)</STRONG>. Tabs may be oriented along either the north,
|
355 |
|
|
south, east, or west sides with the <STRONG>tabPos</STRONG> option. North and
|
356 |
|
|
south tabs may appear as angled, square, or bevelled. West
|
357 |
|
|
and east tabs may appear as square or bevelled. By changing
|
358 |
|
|
tab gaps, tab angles, bevelling, orientations, colors,
|
359 |
|
|
fonts, start locations, and margins; tabs may appear in a
|
360 |
|
|
wide variety of styles. For example, it is possible to
|
361 |
|
|
implement Microsoft-style tabs, Borland property tab styles,
|
362 |
|
|
or Borland Delphi style tabs all with the same tabnotebook.
|
363 |
|
|
|
364 |
|
|
|
365 |
|
|
</PRE>
|
366 |
|
|
<H2>WIDGET-SPECIFIC METHODS</H2><PRE>
|
367 |
|
|
The <STRONG>tabnotebook</STRONG> command creates a new Tcl command whose name
|
368 |
|
|
is <EM>pathName</EM>. This command may be used to invoke various
|
369 |
|
|
operations on the widget. It has the following general form:
|
370 |
|
|
|
371 |
|
|
<EM>pathName</EM> <EM>option</EM> ?<EM>arg</EM> <EM>arg</EM> ...?
|
372 |
|
|
|
373 |
|
|
<EM>option</EM> and the <EM>arg</EM>s determine the exact behavior of the com-
|
374 |
|
|
mand.
|
375 |
|
|
|
376 |
|
|
Many of the widget commands for a notebook take as one argu-
|
377 |
|
|
ment an indicator of which page of the notebook to operate
|
378 |
|
|
on. These indicators are called indexes and may be specified
|
379 |
|
|
in any of the following forms:
|
380 |
|
|
|
381 |
|
|
<EM>number</EM>
|
382 |
|
|
Specifies the page numerically, where 0 corresponds to
|
383 |
|
|
the first page in the notebook, 1 to the second, and so
|
384 |
|
|
on.
|
385 |
|
|
|
386 |
|
|
<STRONG>select</STRONG>
|
387 |
|
|
Specifies the currently selected page's index. If no
|
388 |
|
|
page is currently selected, the value -1 is returned.
|
389 |
|
|
|
390 |
|
|
<STRONG>end</STRONG> Specifes the last page in the tabnotebook's index. If
|
391 |
|
|
the notebook is empty this will return -1.
|
392 |
|
|
|
393 |
|
|
<EM>pattern</EM>
|
394 |
|
|
If the index doesn't satisfy any of the above forms,
|
395 |
|
|
then this form is used. Pattern is pattern-matched
|
396 |
|
|
against the label of each page in the notebook, in
|
397 |
|
|
order from the first to the last page, until a matching
|
398 |
|
|
entry is found. The rules of Tcl_StringMatch are used.
|
399 |
|
|
The following commands are possible for tabnotebook
|
400 |
|
|
widgets:
|
401 |
|
|
|
402 |
|
|
<EM>pathName</EM> <STRONG>add</STRONG> ?<EM>option</EM> <EM>value</EM> <EM>option</EM> <EM>value</EM> ...?
|
403 |
|
|
Add a new page at the end of the tabnotebook. A new
|
404 |
|
|
child site frame is created. Returns the child site
|
405 |
|
|
pathName. If additional arguments are present, they
|
406 |
|
|
specify any of the following options:
|
407 |
|
|
|
408 |
|
|
<STRONG>-angle</STRONG> <EM>value</EM>
|
409 |
|
|
Specifes the angle of slope from the inner edge to
|
410 |
|
|
the outer edge of the tab. An angle of 0 specifies
|
411 |
|
|
square tabs. Valid ranges are 0 to 45 degrees
|
412 |
|
|
inclusive. Default is 15 degrees. If this option
|
413 |
|
|
is specified as an empty string (the default),
|
414 |
|
|
then the angle option for the overall tabnotebook
|
415 |
|
|
is used. This is generally only set at the tab-
|
416 |
|
|
notebook level. Tabs normally will want to share
|
417 |
|
|
the same angle value.
|
418 |
|
|
|
419 |
|
|
<STRONG>-background</STRONG> <EM>value</EM>
|
420 |
|
|
Specifies a background color to use for displaying
|
421 |
|
|
tabs when they are selected and for displaying the
|
422 |
|
|
current page. If this option is specified as an
|
423 |
|
|
empty string (the default), then the background
|
424 |
|
|
option for the overall tabnotebook is used.
|
425 |
|
|
|
426 |
|
|
<STRONG>-bevelamount</STRONG> <EM>value</EM>
|
427 |
|
|
Specifes the size of tab corners. A value of 0
|
428 |
|
|
with angle set to 0 results in square tabs. A
|
429 |
|
|
bevelAmount of 4, means that the tab will be drawn
|
430 |
|
|
with angled corners that cut in 4 pixels from the
|
431 |
|
|
edge of the tab. The default is 0. This is gen-
|
432 |
|
|
erally only set at the tabnotebook level. Tabs
|
433 |
|
|
normally will want to share the same bevelAmount.
|
434 |
|
|
|
435 |
|
|
<STRONG>-bitmap</STRONG> <EM>value</EM>
|
436 |
|
|
If label is a non-empty string, specifies a bitmap
|
437 |
|
|
to display in this page's tab. Bitmap may be of
|
438 |
|
|
any of the forms accepted by Tk_GetPixmap.
|
439 |
|
|
|
440 |
|
|
<STRONG>-command</STRONG> <EM>value</EM>
|
441 |
|
|
Specifies a Tcl command to be executed when this
|
442 |
|
|
page is selected. This allows the programmer a
|
443 |
|
|
hook to reconfigure this page's widgets or any
|
444 |
|
|
other page's widgets.
|
445 |
|
|
|
446 |
|
|
If the tabnotebook has the auto option set to
|
447 |
|
|
true, when a page is selected this command will be
|
448 |
|
|
called immediately after the previously selected
|
449 |
|
|
page is unpacked and immediately before this page
|
450 |
|
|
is selected. The index value select is valid dur-
|
451 |
|
|
ing this Tcl command. `index select' will return
|
452 |
|
|
this page's page number.
|
453 |
|
|
|
454 |
|
|
If the auto option is set to false, when a page is
|
455 |
|
|
selected the unpack and pack calls are bypassed.
|
456 |
|
|
This Tcl command is still called.
|
457 |
|
|
|
458 |
|
|
<STRONG>-disabledforeground</STRONG> <EM>value</EM>
|
459 |
|
|
Specifies a foreground color to use for displaying
|
460 |
|
|
tab labels when tabs are in their disable state.
|
461 |
|
|
If this option is specified as an empty string
|
462 |
|
|
(the default), then the disabledforeground option
|
463 |
|
|
for the overall tabnotebook is used.
|
464 |
|
|
|
465 |
|
|
<STRONG>-font</STRONG> <EM>value</EM>
|
466 |
|
|
Specifies the font to use when drawing a text
|
467 |
|
|
label on a page tab. If this option is specified
|
468 |
|
|
as an empty string then the font option for the
|
469 |
|
|
overall tabnotebook is used..
|
470 |
|
|
|
471 |
|
|
<STRONG>-foreground</STRONG> <EM>value</EM>
|
472 |
|
|
Specifies a foreground color to use for displaying
|
473 |
|
|
tab labels when they are selected. If this option
|
474 |
|
|
is specified as an empty string (the default),
|
475 |
|
|
then the foreground option for the overall tab-
|
476 |
|
|
notebook is used.
|
477 |
|
|
|
478 |
|
|
<STRONG>-label</STRONG> <EM>value</EM>
|
479 |
|
|
Specifies a string to display as an identifying
|
480 |
|
|
label for a notebook page. This label serves as an
|
481 |
|
|
additional identifier used to reference the page.
|
482 |
|
|
This label may be used for the index value in
|
483 |
|
|
widget commands.
|
484 |
|
|
|
485 |
|
|
<STRONG>-tabbackground</STRONG> <EM>value</EM>
|
486 |
|
|
Specifies a background color to use for displaying
|
487 |
|
|
a tab when it is not elected. If this option is
|
488 |
|
|
specified as an empty string (the default), then
|
489 |
|
|
the tabBackground option for the overall tabnote-
|
490 |
|
|
book is used.
|
491 |
|
|
|
492 |
|
|
<STRONG>-tabforeground</STRONG> <EM>value</EM>
|
493 |
|
|
Specifies a foreground color to use for displaying
|
494 |
|
|
the tab's text label when it is not selected. If
|
495 |
|
|
this option is specified as an empty string (the
|
496 |
|
|
default), then the tabForeground option for the
|
497 |
|
|
overall tabnotebook is used.
|
498 |
|
|
|
499 |
|
|
<STRONG>-padx</STRONG> <EM>value</EM>
|
500 |
|
|
Specifies a non-negative value indicating how much
|
501 |
|
|
extra space to request for a tab around its label
|
502 |
|
|
in the X-direction. When computing how large a
|
503 |
|
|
window it needs, the tab will add this amount to
|
504 |
|
|
the width it would normally need The tab will end
|
505 |
|
|
up with extra internal space to the left and right
|
506 |
|
|
of its text label. This value may have any of the
|
507 |
|
|
forms acceptable to Tk_GetPixels. If this option
|
508 |
|
|
is specified as an empty string (the default),
|
509 |
|
|
then the padX option for the overall tabnotebook
|
510 |
|
|
is used
|
511 |
|
|
|
512 |
|
|
<STRONG>-pady</STRONG> <EM>value</EM>
|
513 |
|
|
Specifies a non-negative value indicating how much
|
514 |
|
|
extra space to request for a tab around its label
|
515 |
|
|
in the Y-direction. When computing how large a
|
516 |
|
|
window it needs, the tab will add this amount to
|
517 |
|
|
the height it would normally need The tab will end
|
518 |
|
|
up with extra internal space to the top and bottom
|
519 |
|
|
of its text label. This value may have any of the
|
520 |
|
|
forms acceptable to Tk_GetPixels. If this option
|
521 |
|
|
is specified as an empty string (the default),
|
522 |
|
|
then the padY option for the overall tabnotebook
|
523 |
|
|
is used
|
524 |
|
|
|
525 |
|
|
<STRONG>-state</STRONG> <EM>value</EM>
|
526 |
|
|
Specifies one of two states for the page: normal
|
527 |
|
|
or disabled. In normal state unselected tabs are
|
528 |
|
|
displayed using the tabforeground and tabback-
|
529 |
|
|
ground option from the tabnotebook or the page.
|
530 |
|
|
Selected tabs and pages are displayed using the
|
531 |
|
|
foreground and background option from the tabnote-
|
532 |
|
|
book or the page. The disabled state means that
|
533 |
|
|
the page and its tab is insensitive: it doesn't
|
534 |
|
|
respond to mouse button presses or releases. In
|
535 |
|
|
this state the entry is displayed according to its
|
536 |
|
|
disabledForeground option for the tabnotebook and
|
537 |
|
|
the background/tabbackground option from the page
|
538 |
|
|
or the tabnotebook.
|
539 |
|
|
|
540 |
|
|
<EM>pathName</EM> <STRONG>childSite</STRONG> ?<EM>index</EM>?
|
541 |
|
|
If passed no arguments, returns a list of pathNames for
|
542 |
|
|
all the pages in the tabnotebook. If the tab notebook
|
543 |
|
|
is empty, an empty list is returned
|
544 |
|
|
|
545 |
|
|
If <EM>index</EM> is passed, it returns the <EM>pathName</EM> for the
|
546 |
|
|
page's child site <STRONG>frame</STRONG> specified by <EM>index</EM>. Widgets
|
547 |
|
|
that are created with this <EM>pathName</EM> will be displayed
|
548 |
|
|
when the associated page is selected. If <EM>index</EM> is not a
|
549 |
|
|
valid index, an empty string is returned.
|
550 |
|
|
|
551 |
|
|
<EM>pathName</EM> <STRONG>configure</STRONG> ?<EM>option</EM>? ?<EM>value</EM> <EM>option</EM> <EM>value</EM> ...?
|
552 |
|
|
Query or modify the configuration options of the
|
553 |
|
|
widget. If no <EM>option</EM> is specified, returns a list
|
554 |
|
|
describing all of the available options for <EM>pathName</EM>
|
555 |
|
|
(see <STRONG>Tk_ConfigureInfo</STRONG> for information on the format of
|
556 |
|
|
this list). If option is specified with no value, then
|
557 |
|
|
the command returns a list describing the one named
|
558 |
|
|
option (this list will be identical to the correspond-
|
559 |
|
|
ing sublist of the value returned if no option is
|
560 |
|
|
specified). If one or more option-value pairs are
|
561 |
|
|
specified, then the command modifies the given widget
|
562 |
|
|
option(s) to have the given value(s); in this case the
|
563 |
|
|
command returns an empty string. <EM>Option</EM> may have any of
|
564 |
|
|
the values accepted by the tabnotebook command.
|
565 |
|
|
|
566 |
|
|
<EM>pathName</EM> <STRONG>delete</STRONG> <EM>index1</EM> ?<EM>index2</EM>?
|
567 |
|
|
Delete all of the pages between <EM>index1</EM> and <EM>index2</EM>
|
568 |
|
|
inclusive. If <EM>index2</EM> is omitted then it defaults to
|
569 |
|
|
<EM>index1</EM>. Returns an empty string.
|
570 |
|
|
|
571 |
|
|
<EM>pathName</EM> <STRONG>index</STRONG> <EM>index</EM>
|
572 |
|
|
Returns the numerical index corresponding to <EM>index</EM>.
|
573 |
|
|
|
574 |
|
|
<EM>pathName</EM> <STRONG>insert</STRONG> <EM>index</EM> ?<EM>option</EM> <EM>value</EM> <EM>option</EM> <EM>value</EM> ...?
|
575 |
|
|
Insert a new page in the tabnotebook before the page
|
576 |
|
|
specified by <EM>index</EM>. A new child site <STRONG>frame</STRONG> is created.
|
577 |
|
|
The additional arguments are the same as for the <STRONG>add</STRONG>
|
578 |
|
|
command. Returns the child site <EM>pathName</EM>.
|
579 |
|
|
|
580 |
|
|
<EM>pathName</EM> <STRONG>next</STRONG>
|
581 |
|
|
Advances the selected page to the next page (order is
|
582 |
|
|
determined by insertion order). If the currently
|
583 |
|
|
selected page is the last page in the notebook, the
|
584 |
|
|
selection wraps around to the first page in the note-
|
585 |
|
|
book. It behaves as if the user selected the new page.
|
586 |
|
|
|
587 |
|
|
For notebooks with <STRONG>auto</STRONG> set to <STRONG>true</STRONG> the current page's
|
588 |
|
|
child site is unpacked from the notebook's child site
|
589 |
|
|
frame. Then the next page's child site is packed into
|
590 |
|
|
the notebook's child site frame. The Tcl command given
|
591 |
|
|
with the command option will be invoked between these
|
592 |
|
|
two operations.
|
593 |
|
|
|
594 |
|
|
For notebooks with <STRONG>auto</STRONG> set to <STRONG>false</STRONG> the Tcl command
|
595 |
|
|
given with the command option will be invoked.
|
596 |
|
|
|
597 |
|
|
<EM>pathName</EM> <STRONG>pageconfigure</STRONG> <EM>index</EM> ?<EM>option</EM>? ?<EM>value</EM> <EM>option</EM> <EM>value</EM> ...?
|
598 |
|
|
This command is similar to the <STRONG>configure</STRONG> command,
|
599 |
|
|
except that it applies to the options for an individual
|
600 |
|
|
page, whereas configure applies to the options for the
|
601 |
|
|
tabnotebook as a whole. <EM>Options</EM> may have any of the
|
602 |
|
|
values accepted by the add widget command. If options
|
603 |
|
|
are specified, options are modified as indicated in the
|
604 |
|
|
command and the command returns an empty string. If no
|
605 |
|
|
options are specified, returns a list describing the
|
606 |
|
|
current options for page index (see <STRONG>Tk_ConfigureInfo</STRONG>
|
607 |
|
|
for information on the format of this list).
|
608 |
|
|
|
609 |
|
|
<EM>pathName</EM> <STRONG>prev</STRONG>
|
610 |
|
|
Moves the selected page to the previous page (order is
|
611 |
|
|
determined by insertion order). If the currently
|
612 |
|
|
selected page is the first page in the notebook, the
|
613 |
|
|
selection wraps around to the last page in the note-
|
614 |
|
|
book. It behaves as if the user selected the new page.
|
615 |
|
|
|
616 |
|
|
For notebooks with <STRONG>auto</STRONG> set to <STRONG>true</STRONG> the current page's
|
617 |
|
|
child site is unpacked from the notebook's child site
|
618 |
|
|
<STRONG>frame</STRONG>. Then the previous page's child site is packed
|
619 |
|
|
into the notebook's child site frame. The Tcl command
|
620 |
|
|
given with the command option will be invoked between
|
621 |
|
|
these two operations.
|
622 |
|
|
|
623 |
|
|
For notebooks with <STRONG>auto</STRONG> set to <STRONG>false</STRONG> the Tcl command
|
624 |
|
|
given with the command option will be invoked.
|
625 |
|
|
|
626 |
|
|
<EM>pathName</EM> <STRONG>select</STRONG> <EM>index</EM>
|
627 |
|
|
Selects the page specified by <EM>index</EM> as the currently
|
628 |
|
|
selected page. It behaves as if the user selected the
|
629 |
|
|
new page.
|
630 |
|
|
|
631 |
|
|
For notebooks with <STRONG>auto</STRONG> set to <STRONG>true</STRONG> the current page's
|
632 |
|
|
child site is unpacked from the notebook's child site
|
633 |
|
|
frame. Then the <EM>index</EM> page's child site is packed into
|
634 |
|
|
the notebook's child site frame. The Tcl command given
|
635 |
|
|
with the command option will be invoked between these
|
636 |
|
|
two operations.
|
637 |
|
|
|
638 |
|
|
For notebooks with <STRONG>auto</STRONG> set to <STRONG>false</STRONG> the Tcl command
|
639 |
|
|
given with the command option will be invoked.
|
640 |
|
|
|
641 |
|
|
<EM>pathName</EM> <STRONG>view</STRONG>
|
642 |
|
|
Returns the currently selected page. This command is
|
643 |
|
|
for compatibility with the <STRONG>scrollbar</STRONG> widget.
|
644 |
|
|
|
645 |
|
|
<EM>pathName</EM> <STRONG>view</STRONG> <EM>index</EM>
|
646 |
|
|
Selects the page specified by <EM>index</EM> as the currently
|
647 |
|
|
selected page. This command is for compatibility with
|
648 |
|
|
the <STRONG>scrollbar</STRONG> widget.
|
649 |
|
|
|
650 |
|
|
<EM>pathName</EM> <STRONG>view</STRONG> <STRONG>moveto</STRONG> <EM>fraction</EM>
|
651 |
|
|
Uses the <EM>fraction</EM> value to determine the corresponding
|
652 |
|
|
page to move to. This command is for compatibility with
|
653 |
|
|
the <STRONG>scrollbar</STRONG> widget.
|
654 |
|
|
|
655 |
|
|
<EM>pathName</EM> <STRONG>view</STRONG> <STRONG>scroll</STRONG> <EM>num</EM> <EM>what</EM>
|
656 |
|
|
Uses the <EM>num</EM> value to determine how many pages to move
|
657 |
|
|
forward or backward (<EM>num</EM> can be negative or positive).
|
658 |
|
|
The <EM>what</EM> argument is ignored. This command is for com-
|
659 |
|
|
patibility with the <STRONG>scrollbar</STRONG> widget.
|
660 |
|
|
|
661 |
|
|
|
662 |
|
|
</PRE>
|
663 |
|
|
<H2>COMPONENTS</H2><PRE>
|
664 |
|
|
Generally all behavior of the internal components, <STRONG>tabset</STRONG>
|
665 |
|
|
and <STRONG>notebook</STRONG> are controlled via the <STRONG>pageconfigure</STRONG> method.
|
666 |
|
|
The following section documents these two components.
|
667 |
|
|
|
668 |
|
|
Name: <STRONG>tabset</STRONG>
|
669 |
|
|
Class: <STRONG>Tabset</STRONG>
|
670 |
|
|
|
671 |
|
|
This is the tabset component. It implements the tabs
|
672 |
|
|
that are associated with the notebook component.
|
673 |
|
|
|
674 |
|
|
See the "<STRONG>Tabset</STRONG>" widget manual entry for details on the
|
675 |
|
|
<STRONG>tabset</STRONG> component item.
|
676 |
|
|
|
677 |
|
|
Name: <STRONG>notebook</STRONG>
|
678 |
|
|
Class: <STRONG>Notebook</STRONG>
|
679 |
|
|
|
680 |
|
|
This is the notebook component. It implements the note-
|
681 |
|
|
book that contains the pages of the tabnotebook.
|
682 |
|
|
|
683 |
|
|
See the "<STRONG>Notebook</STRONG>" widget manual entry for details on
|
684 |
|
|
the <STRONG>notebook</STRONG> component item.
|
685 |
|
|
|
686 |
|
|
|
687 |
|
|
</PRE>
|
688 |
|
|
<H2>EXAMPLE</H2><PRE>
|
689 |
|
|
Following is an example that creates a tabnotebook with two
|
690 |
|
|
pages.
|
691 |
|
|
|
692 |
|
|
# Create the tabnotebook widget and pack it.
|
693 |
|
|
tabnotebook .tn -width 100 -height 100
|
694 |
|
|
pack .tn \
|
695 |
|
|
-anchor nw \
|
696 |
|
|
-fill both \
|
697 |
|
|
-expand yes \
|
698 |
|
|
-side left \
|
699 |
|
|
-padx 10 \
|
700 |
|
|
-pady 10
|
701 |
|
|
|
702 |
|
|
# Add two pages to the tabnotebook,
|
703 |
|
|
# labelled "Page One" and "Page Two"
|
704 |
|
|
.tn add -label "Page One"
|
705 |
|
|
.tn add -label "Page Two"
|
706 |
|
|
|
707 |
|
|
# Get the child site frames of these two pages.
|
708 |
|
|
set page1CS [.tn childsite 0]
|
709 |
|
|
set page2CS [.tn childsite "Page Two"]
|
710 |
|
|
|
711 |
|
|
# Create buttons on each page of the tabnotebook.
|
712 |
|
|
button $page1CS.b -text "Button One"
|
713 |
|
|
pack $page1CS.b
|
714 |
|
|
button $page2CS.b -text "Button Two"
|
715 |
|
|
pack $page2CS.b
|
716 |
|
|
|
717 |
|
|
# Select the first page of the tabnotebook.
|
718 |
|
|
.tn select 0
|
719 |
|
|
|
720 |
|
|
|
721 |
|
|
</PRE>
|
722 |
|
|
<H2>AUTHOR</H2><PRE>
|
723 |
|
|
Bill W. Scott
|
724 |
|
|
|
725 |
|
|
|
726 |
|
|
</PRE>
|
727 |
|
|
<H2>KEYWORDS</H2><PRE>
|
728 |
|
|
tab tabset notebook tabnotebook page
|
729 |
|
|
|
730 |
|
|
|
731 |
|
|
|
732 |
|
|
|
733 |
|
|
|
734 |
|
|
|
735 |
|
|
|
736 |
|
|
|
737 |
|
|
|
738 |
|
|
|
739 |
|
|
|
740 |
|
|
|
741 |
|
|
|
742 |
|
|
|
743 |
|
|
|
744 |
|
|
|
745 |
|
|
|
746 |
|
|
|
747 |
|
|
|
748 |
|
|
|
749 |
|
|
|
750 |
|
|
|
751 |
|
|
|
752 |
|
|
|
753 |
|
|
|
754 |
|
|
|
755 |
|
|
|
756 |
|
|
|
757 |
|
|
|
758 |
|
|
|
759 |
|
|
|
760 |
|
|
|
761 |
|
|
|
762 |
|
|
|
763 |
|
|
|
764 |
|
|
|
765 |
|
|
|
766 |
|
|
|
767 |
|
|
|
768 |
|
|
</PRE>
|
769 |
|
|
</BODY>
|
770 |
|
|
</HTML>
|