1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738
|
<!-- manual page source format generated by RosettaMan v2.5a6, -->
<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
<HTML>
<HEAD>
<TITLE>man page(1) manual page</TITLE>
</HEAD>
<BODY>
<A HREF="#toc">Table of Contents</A><P>
_________________________________________________________________
<P>
<H2><A NAME="sect1" HREF="#toc1"><B>NAME</B></A></H2>
tabset - create and manipulate tabs as as set
<P>
<H2><A NAME="sect2" HREF="#toc2"><B>SYNOPSIS</B></A></H2>
<B>tabset</B> <I>pathName</I> ?<I>options</I>?
<P>
<H2><A NAME="sect3" HREF="#toc3"><B>INHERITANCE</B></A></H2>
itk::Widget <- tabset
<P>
<H2><A NAME="sect4" HREF="#toc4"><B>STANDARD</B> <B>OPTIONS</B></A></H2>
<B>background</B> <B>font</B> <B>selectBackgroundcursor</B>
<B>foreground</B> <B>selectForeground</B> <B>disabledForegroundheight</B>
<B>width</B>
<P>
See the "options" manual entry for details on the standard
options.
<P>
<H2><A NAME="sect5" HREF="#toc5"><B>WIDGET-SPECIFIC</B> <B>OPTIONS</B></A></H2>
<DL>
<DT>Name: <DD> <B>angle</B>
</DD>
</DL>
<DL>
<DT>Class: <DD> <B>Angle</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD> <B>-angle</B>
<P>
</DD>
</DL>
Specifes the angle of slope from the inner edge to the
outer edge of the tab. An angle of 0 specifies square
tabs. Valid ranges are 0 to 45 degrees inclusive.
Default is 15 degrees. If tabPos is e or w, this option
is ignored.
<P>
<DL>
<DT>Name: <DD> <B>backdrop</B>
</DD>
</DL>
<DL>
<DT>Class: <DD> <B>Backdrop</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD> <B>-backdrop</B>
<P>
</DD>
</DL>
Specifies a background color to use when filling in the
area behind the tabs.
<P>
<DL>
<DT>Name: <DD> <B>bevelAmount</B>
</DD>
</DL>
<DL>
<DT>Class: <DD> <B>BevelAmount</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD> <B>-bevelamount</B>
<P>
</DD>
</DL>
Specifes the size of tab corners. A value of 0 with
angle set to 0 results in square tabs. A <B>bevelAmount</B> of
4, means that the tab will be drawn with angled corners
that cut in 4 pixels from the edge of the tab. The
default is 0.
<P>
<DL>
<DT>Name: <DD> <B>command</B>
</DD>
</DL>
<DL>
<DT>Class: <DD> <B>Command</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD> <B>-command</B>
Specifes the prefix of a Tcl command to invoke to change the view in the
widget associated with the tabset. When a user selects a tab, a Tcl command
is invoked. The actual command consists of this option followed by a space
and a number. The number is the numerical index of the tab that has been
selected.
<P>
</DD>
</DL>
<DL>
<DT>Name: <DD> <B>equalTabs</B>
</DD>
</DL>
<DL>
<DT>Class: <DD> <B>EqualTabs</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD> <B>-equaltabs</B>
<P>
</DD>
</DL>
Specifies whether to force tabs to be equal sized or
not. A value of <B>true</B> means constrain tabs to be equal
sized. A value of <B>false</B> allows each tab to size based
on the text label size. The value may have any of the
forms accepted by the <B>Tcl_GetBoolean</B>, such as <B>true</B>,
<B>false</B>, <B>0</B>, <B>1</B>, <B>yes</B>, or <B>no</B>.
<P>
For horizontally positioned tabs (<B>tabPos</B> is either <B>s</B> or
<B>n</B>), <B>true</B> forces all tabs to be equal width (the width
being equal to the longest label plus any padX specified).
Horizontal tabs are always equal in height.
<P>
For vertically positioned tabs (<B>tabPos</B> is either <B>w</B> or
<B>e</B>), <B>true</B> forces all tabs to be equal height (the height
being equal to the height of the label with the largest
font). Vertically oriented tabs are always equal in
width.
<P>
<DL>
<DT>Name: <DD> <B>gap</B>
</DD>
</DL>
<DL>
<DT>Class: <DD> <B>Gap</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD> <B>-gap</B>
<P>
</DD>
</DL>
Specifies the amount of pixel space to place between
each tab. Value may be any pixel offset value. In addition,
a special keyword <B>overlap</B> can be used as the
value to achieve a standard overlap of tabs. This value
may have any of the forms acceptable to <B>Tk_GetPixels</B>.
<P>
<DL>
<DT>Name: <DD> <B>margin</B>
</DD>
</DL>
<DL>
<DT>Class: <DD> <B>Margin</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD> <B>-margin</B>
<P>
</DD>
</DL>
Specifies the amount of space to place between the outside
edge of the tabset and the outside edge of its
tabs. If <B>tabPos</B> is <B>s</B>, this is the amount of space
between the bottom edge of the tabset and the bottom
edge of the set of tabs. If <B>tabPos</B> is <B>n</B>, this is the
amount of space between the top edge of the tabset and
the top edge of the set of tabs. If <B>tabPos</B> is <B>e</B>, this
is the amount of space between the right edge of the
tabset and the right edge of the set of tabs. If <B>tabPos</B>
is <B>w</B>, this is the amount of space between the left edge
of the tabset and the left edge of the set of tabs.
This value may have any of the forms acceptable to
<P>
<B>Tk_GetPixels</B>.
<P>
<DL>
<DT>Name: <DD> <B>padX</B>
</DD>
</DL>
<DL>
<DT>Class: <DD> <B>PadX</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD> <B>-padx</B>
<P>
</DD>
</DL>
Specifies a non-negative value indicating how much
extra space to request for a tab around its label in
the X-direction. When computing how large a window it
needs, the tab will add this amount to the width it
would normally need The tab will end up with extra
internal space to the left and right of its text label.
This value may have any of the forms acceptable to
<B>Tk_GetPixels</B>.
<P>
<DL>
<DT>Name: <DD> <B>padY</B>
</DD>
</DL>
<DL>
<DT>Class: <DD> <B>PadY</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD> <B>-pady</B>
<P>
</DD>
</DL>
Specifies a non-negative value indicating how much
extra space to request for a tab around its label in
the Y-direction. When computing how large a window it
needs, the tab will add this amount to the height it
would normally need The tab will end up with extra
internal space to the top and bottom of its text label.
This value may have any of the forms acceptable to
<B>Tk_GetPixels</B>.
<P>
<DL>
<DT>Name: <DD> <B>raiseSelect</B>
</DD>
</DL>
<DL>
<DT>Class: <DD> <B>RaiseSelect</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD> <B>-raiseselect</B>
<P>
</DD>
</DL>
Specifes whether to slightly raise the selected tab
from the rest of the tabs. The selected tab is drawn 2
pixels closer to the outside edge of the tabset than
the unselected tabs. A value of true says to raise
selected tabs, a value of false turns this off. The
default is false. The value may have any of the forms
accepted by the <B>Tcl_GetBoolean</B>, such as <B>true</B>, <B>false</B>, <B>0</B>,
<B>1</B>, <B>yes</B>, or <B>no</B>.
<P>
<DL>
<DT>Name: <DD> <B>start</B>
</DD>
</DL>
<DL>
<DT>Class: <DD> <B>Start</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD> <B>-start</B>
<P>
</DD>
</DL>
Specifies the amount of space to place between the left
or top edge of the tabset and the starting edge of its
tabs. For horizontally positioned tabs, this is the
amount of space between the left edge of the tabset and
the left edge of the first tab. For vertically positioned
tabs, this is the amount of space between the
top of the tabset and the top of the first tab. This
value may change if the user performs a MButton-2
scroll on the tabs. This value may have any of the
forms acceptable to <B>Tk_GetPixels</B>.
<P>
<DL>
<DT>Name: <DD> <B>state</B>
</DD>
</DL>
<DL>
<DT>Class: <DD> <B>State</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD> <B>-state</B>
<P>
</DD>
</DL>
Sets the active state of the tabset. Specifying <B>normal</B>
allows all tabs to be selectable. Specifying <B>disabled</B>
disables the tabset causing all tabs to be drawn in the
disabledForeground color.
<P>
<DL>
<DT>Name: <DD> <B>tabBorders</B>
</DD>
</DL>
<DL>
<DT>Class: <DD> <B>TabBorders</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD> <B>-tabborders</B>
<P>
</DD>
</DL>
Specifies whether to draw the borders of tabs that are
not selected. Specifying true (the default) draws these
borders, specifying false draws only the border around
the selected tab. The value may have any of the forms
accepted by the <B>Tcl_GetBoolean</B>, such as <B>true</B>, <B>false,</B> <B>0</B>,
<B>1</B>, <B>yes</B>, or <B>no</B>.
<P>
<DL>
<DT>Name: <DD> <B>tabPos</B>
</DD>
</DL>
<DL>
<DT>Class: <DD> <B>TabPos</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD> <B>-tabpos</B>
<P>
</DD>
</DL>
Specifies the location of the set of tabs in relation
to another widget. Must be <B>n</B>, <B>s</B>, <B>e</B>, or <B>w</B>. Defaults to
<B>s</B>. North tabs open downward, South tabs open upward.
West tabs open to the right, east tabs open to the
left.<BR>
_________________________________________________________________
<P>
<H2><A NAME="sect6" HREF="#toc6"><B>DESCRIPTION</B></A></H2>
The <B>tabset</B> command creates a new window (given by the pathName
argument) and makes it into a <B>tabset</B> widget. Additional
<I>options</I>, described above may be specified on the command
line or in the option database to configure aspects of the
tabset such as its colors, font, and text. The <B>tabset</B> command
returns its <I>pathName</I> argument. At the time this command
is invoked, there must not exist a window named <I>pathName</I>,
but pathName's parent must exist.
<P>
A <B>tabset</B> is a widget that contains a set of Tab buttons. It
displays these tabs in a row or column depending on it tabpos.
When a tab is clicked on, it becomes the only tab in
the tab set that is selected. All other tabs are deselected.
The Tcl command prefix associated with this tab (through the
command tab configure option) is invoked with the tab index
number appended to its argument list. This allows the tabset
to control another widget such as a Notebook.
<P>
<H2><A NAME="sect7" HREF="#toc7"><B>TABS</B></A></H2>
Tabs are drawn to appear attached to another widget. The
tabset draws an edge boundary along one of its edges. This
edge is known as the attachment edge. This edge location is
dependent on the value of <B>tabPos</B>. For example, if <B>tabPos</B> is
<B>s</B>, the attachment edge wil be on the top side of the tabset
(in order to attach to the bottom or south side of its
attached widget). The selected tab is draw with a 3d relief
to appear above the other tabs. This selected tab "opens"
toward attachment edge.
<P>
Tabs can be controlled in their location along the edges,
the angle that tab sides are drawn with, gap between tabs,
starting margin of tabs, internal padding around labels in a
tab, the font, and its text or bitmap.
<P>
<H2><A NAME="sect8" HREF="#toc8"><B>WIDGET-SPECIFIC</B> <B>METHODS</B></A></H2>
The <B>tabset</B> command creates a new Tcl command whose name is
<I>pathName</I>. This command may be used to invoke various operations
on the widget. It has the following general form:
<P>
<I>pathName</I> <I>option</I> ?<I>arg</I> <I>arg</I> ...?
<P>
<I>option</I> and the <I>arg</I>s determine the exact behavior of the command.
<P>
Many of the widget commands for a tabset take as one argument
an indicator of which tab of the tabset to operate on.
These indicators are called indexes and may be specified in
any of the following forms:
<P>
<I>number</I><BR>
Specifies the tab numerically, where 0 corresponds to
the first tab in the tab set, 1 to the second, and so
on.
<P>
<B>select</B><BR>
Specifies the currently selected tab's index. If no tab
is currently selected, the value -1 is returned.
<P>
<B>end</B> Specifes the last tab in the tabset's index. If the
tabset is empty this will return -1.
<P>
<I>pattern</I><BR>
If the index doesn't satisfy any of the above forms,
then this form is used. Pattern is pattern-matched
against the label of each tab in the tabset, in order
from the first to the last tab, until a matching entry
is found. The rules of Tcl_StringMatch are used.
<P>
The following commands are possible for tabset widgets:
<P>
<I>pathName</I> <B>add</B> ?<I>option</I> <I>value</I> <I>option</I> <I>value</I> ...?
Add a new tab at the end of the tabset. Returns
the child site <I>pathName</I>. If additional arguments
are present, they specify any of the following
options:
<P>
<DL>
<DT><B>-angle</B> <I>value</I><DD>
Specifes the angle of slope from the inner
edge to the outer edge of the tab. An angle
of 0 specifies square tabs. Valid ranges are
0 to 45 degrees inclusive. Default is 15
degrees. If this option is specified as an
empty string (the default), then the angle
option for the overall tabset is used.
<P>
</DD>
</DL>
<DL>
<DT><B>-background</B> <I>value</I><DD>
Specifies a background color to use for
displaying tabs when they are in their normal
state (unselected). If this option is specified
as an empty string (the default), then
the background option for the overall tabset
is used.
<P>
</DD>
</DL>
<DL>
<DT><B>-bevelamount</B> <I>value</I><DD>
Specifes the size of tab corners. A value of
0 with angle set to 0 results in square tabs.
A bevelAmount of 4, means that the tab will
be drawn with angled corners that cut in 4
pixels from the edge of the tab. The default
is 0. This is generally only set at the tabset
configuration level. Tabs normally will
want to share the same bevelAmount.
<P>
</DD>
</DL>
<DL>
<DT><B>-bitmap</B> <I>value</I><DD>
If label is a non-empty string, specifies a
bitmap to display in the tab. Bitmap may be
of any of the forms accepted by Tk_GetBitmap.
<P>
</DD>
</DL>
<DL>
<DT><B>-disabledforeground</B> <I>value</I><DD>
Specifies a foreground color to use for
displaying tab labels when tabs are in their
disable state. If this option is specified as
an empty string (the default), then the disabledforeground
option for the overall tabset
is used.
<P>
</DD>
</DL>
<DL>
<DT><B>-font</B> <I>value</I><DD>
Specifies the font to use when drawing the
label on a tab. If this option is specified
as an empty string then the font option for
the overall tabset is used.
<P>
</DD>
</DL>
<DL>
<DT><B>-foreground</B> <I>value</I><DD>
Specifies a foreground color to use for
displaying tab labels when tabs are in their
normal unselected state. If this option is
specified as an empty string (the default),
then the foreground option for the overall
tabset is used.
<P>
</DD>
</DL>
<DL>
<DT><B>-image</B> <I>value</I><DD>
If label is a non-empty string, specifies an
image to display in the tab. Image must have
been created with the image create command.
Typically, if the image option is specified
then it overrides other options that specify
a bitmap or textual value to display in the
widget; the image option may be reset to an
empty string to re-enable a bitmap or text
display.
<P>
</DD>
</DL>
<DL>
<DT><B>-label</B> <I>value</I><DD>
Specifies a text string to be placed in the
tabs label. If this value is set, the bitmap
option is overridden and this option is used
instead. This label serves as an additional
identifier used to reference the tab. This
label may be used for the index value in
widget commands.
<P>
</DD>
</DL>
<DL>
<DT><B>-selectbackground</B> <I>value</I><DD>
Specifies a background color to use for
displaying the selected tab. If this option
is specified as an empty string (the
default), then the selectBackground option
for the overall tabset is used.
<P>
</DD>
</DL>
<DL>
<DT><B>-selectforeground</B> <I>value</I><DD>
Specifies a foreground color to use for
displaying the selected tab. If this option
is specified as an empty string (the
default), then the selectForeground option
for the overall tabset is used.
<P>
</DD>
</DL>
<DL>
<DT><B>-padx</B> <I>value</I><DD>
Specifies a non-negative value indicating how
much extra space to request for a tab around
its label in the X-direction. When computing
how large a window it needs, the tab will add
this amount to the width it would normally
need The tab will end up with extra internal
space to the left and right of its text
label. This value may have any of the forms
acceptable to Tk_GetPixels. If this option is
specified as an empty string (the default),
then the padX option for the overall tabset
is used
<P>
</DD>
</DL>
<DL>
<DT><B>-pady</B> <I>value</I><DD>
Specifies a non-negative value indicating how
much extra space to request for a tab around
its label in the Y-direction. When computing
how large a window it needs, the tab will add
this amount to the height it would normally
need The tab will end up with extra internal
space to the top and bottom of its text
label. This value may have any of the forms
acceptable to Tk_GetPixels. If this option is
specified as an empty string (the default),
then the padY option for the overall tabset
is used
<P>
</DD>
</DL>
<DL>
<DT><B>-state</B> <I>value</I><DD>
Sets the state of the tab. Specifying normal
allows this tab to be selectable. Specifying
disabled disables the this tab causing its
tab label to be drawn in the disabledForeground
color. The tab will not respond to
events until the state is set back to normal.
<P>
</DD>
</DL>
<I>pathName</I> <B>configure</B> ?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?
Query or modify the configuration options of the
widget. If no <I>option</I> is specified, returns a list
describing all of the available options for <I>path_Name</I>
(see <B>Tk_ConfigureInfo</B> for information on the
format of this list). If option is specified with
no value, then the command returns a list describing
the one named option (this list will be identical
to the corresponding sublist of the value
returned if no option is specified). If one or
more option-value pairs are specified, then the
command modifies the given widget option(s) to
have the given value(s); in this case the command
returns an empty string. <I>Option</I> may have any of
the values accepted by the tabset command.
<P>
<I>pathName</I> <B>delete</B> <I>index1</I> ?<I>index2</I>?<BR>
Delete all of the tabs between <I>index1</I> and <I>index2</I>
inclusive. If <I>index2</I> is omitted then it defaults
to <I>index1</I>. Returns an empty string.
<P>
<I>pathName</I> <B>index</B> <I>index</I><BR>
Returns the numerical index corresponding to
<I>index</I>.
<P>
<I>pathName</I> <B>insert</B> <I>index</I> ?<I>option</I> <I>value</I> <I>option</I> <I>value</I> ...?
Insert a new tab in the tabset before the tab
specified by <I>index</I>. The additional arguments are
the same as for the <B>add</B> command. Returns the tab's
<I>pathName</I>.
<P>
<I>pathName</I> <B>next</B><BR>
Advances the selected tab to the next tab (order
is determined by insertion order). If the
currently selected tab is the last tab in the tabset,
the selection wraps around to the first tab.
It behaves as if the user selected the next tab.
<P>
<I>pathName</I> <B>tabconfigure</B> <I>index</I> ?<I>option</I>? ?<I>value</I>?
This command is similar to the <B>configure</B> command,
except that it applies to the options for an individual
tab, whereas configure applies to the
options for the tabset as a whole. Options may
have any of the values accepted by the <B>add</B> widget
command. If options are specified, options are
modified as indicated in the command and the command
returns an empty string. If no options are
specified, returns a list describing the current
options for tab index (see <B>Tk_ConfigureInfo</B> for
information on the format of this list).
<P>
<I>pathName</I> <B>prev</B><BR>
Moves the selected tab to the previous tab (order
is determined by insertion order). If the
currently selected tab is the first tab in the
tabset, the selection wraps around to the last tab
in the tabset. It behaves as if the user selected
the previous tab.
<P>
<I>pathName</I> <B>select</B> <I>index</I><BR>
Selects the tab specified by <I>index</I> as the
currently selected tab. It behaves as if the user
selected the new tab.
<P>
<H2><A NAME="sect9" HREF="#toc9"><B>EXAMPLE</B></A></H2>
Following is an example that creates a tabset with two tabs
and a list box that the tabset controls. In addition selecting
an item from the list also selects the corresponding
tab.
<P>
# Define a proc that knows how to select an item
# from a list given an index from the tabset -command callback.
proc selectItem { item } {<BR>
.l selection clear [.l curselection]
.l selection set $item<BR>
.l see $item
<P>
}
<P>
# Define a proc that knows how to select a tab
# given a y pixel coordinate from the list..
proc selectTab { y } {<BR>
set whichItem [.l nearest $y]<BR>
.ts select $whichItem<BR>
}
<P>
# Create a listbox with two items (one and two)
# and bind button 1 press to the selectTab procedure.
listbox .l -selectmode single -exportselection false
.l insert end one<BR>
.l insert end two<BR>
.l selection set 0<BR>
pack .l<BR>
bind .l <ButtonPress-1> { selectTab %y }
<P>
# Create a tabset, set its -command to call selectItem
# Add two labels to the tabset (one and two).
tabset .ts -command selectItem<BR>
.ts add -label 1<BR>
.ts add -label 2<BR>
.ts select 0<BR>
pack .ts -fill x -expand no
<P>
<H2><A NAME="sect10" HREF="#toc10"><B>AUTHOR</B></A></H2>
Bill W. Scott
<P>
<H2><A NAME="sect11" HREF="#toc11"><B>KEYWORDS</B></A></H2>
tab tabset notebook tabnotebook
<P>
<HR><P>
<A NAME="toc"><B>Table of Contents</B></A><P>
<UL>
<LI><A NAME="toc1" HREF="#sect1">NAME</A></LI>
<LI><A NAME="toc2" HREF="#sect2">SYNOPSIS</A></LI>
<LI><A NAME="toc3" HREF="#sect3">INHERITANCE</A></LI>
<LI><A NAME="toc4" HREF="#sect4">STANDARD OPTIONS</A></LI>
<LI><A NAME="toc5" HREF="#sect5">WIDGET-SPECIFIC OPTIONS</A></LI>
<LI><A NAME="toc6" HREF="#sect6">DESCRIPTION</A></LI>
<LI><A NAME="toc7" HREF="#sect7">TABS</A></LI>
<LI><A NAME="toc8" HREF="#sect8">WIDGET-SPECIFIC METHODS</A></LI>
<LI><A NAME="toc9" HREF="#sect9">EXAMPLE</A></LI>
<LI><A NAME="toc10" HREF="#sect10">AUTHOR</A></LI>
<LI><A NAME="toc11" HREF="#sect11">KEYWORDS</A></LI>
</UL>
</BODY></HTML>
|