/usr/share/doc/blt-dev/html/table.html is in blt-dev 2.5.3+dfsg-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
<HTML>
<HEAD>
<TITLE>table(n) manual page</TITLE>
</HEAD>
<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
<A HREF="#toc">Table of Contents</A><P>
<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
table - Arranges widgets in a table
<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
<B>table
<I>container</I></B> ?<I>widget index option value</I>?... <P>
<B>table arrange</B> <I>container</I> <P>
<B>table cget
<I>container</I></B> ?<I>item</I>? <I>option</I> <P>
<B>table configure <I>container</I></B> ?<I>item</I>?... ?<I>option value</I>?...
<P>
<B>table extents <I>container</I></B> <I>item</I> <P>
<B>table forget <I>widget</I></B> ?<I>widget</I>?... <P>
<B>table info <I>container</I></B>
<I>item</I> <P>
<B>table locate <I>container</I></B> <I>x y</I> <P>
<B>table containers </B>?<I>switch</I>? ?<I>arg</I>? <P>
<B>table save
<I>container</I></B> <P>
<B>table search <I>container</I></B> ?<I>switch arg</I>?...
<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
The <B>table</B> command
arranges widgets in a table. The alignment of widgets is determined by their
row and column positions and the number of rows or columns that they span.
<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
Probably the most painstaking aspect of building a graphical
application is getting the placement and size of the widgets just right.
It usually takes many iterations to align widgets and adjust their spacing.
That's because managing the geometry of widgets is simply not a packing
problem, but also graphical design problem. Attributes such as alignment,
symmetry, and balance are more important than minimizing the amount of
space used for packing. <P>
The <B>table</B> geometry manager arranges widgets in a
table. It's easy to align widgets (horizontally and vertically) or to create
empty space to balance the arrangement of the widgets. Widgets (called
<I>slaves</I> in the Tk parlance) are arranged inside a containing widget (called
the <I>master</I>). Widgets are positioned at row,column locations and may span
any number of rows or columns. More than one widget can occupy a single
location. <P>
The placement of widget windows determines both the size and arrangement
of the table. The table queries the requested size of each widget. The
<I>requested size</I> of a widget is the natural size of the widget (before the
widget is shrunk or expanded). The height of each row and the width of
each column is the largest widget spanning that row or column. The size
of the table is in turn the sum of the row and column sizes. This is the
table's <I>normal size</I>. <P>
The total number of rows and columns in a table is determined
from the indices specified. The table grows dynamically as windows are
added at larger indices.
<H2><A NAME="sect4" HREF="#toc4">Example</A></H2>
The table geometry manager is created by
invoking the <B>table</B> command. <BR>
<CODE># Create a table in the root window<BR>
table .<BR>
</CODE><P>The window <I>.</I> is now the <I>container</I> of the table. Widgets are packed into
the table and displayed within the confines of the container. <P>
You add widgets
to the table by row and column location. Row and column indices start from
zero. <BR>
<CODE>label .title -text "This is a title"<BR>
<P>
# Add a label to the table<BR>
table . .title 0,0 <BR>
</CODE><P>The label <I>.title</I> is added to the table. We can add more widgets in the same
way. <BR>
<CODE>button .ok -text "Ok"<BR>
button .cancel -text "Cancel"<BR>
<P>
# Add two buttons<BR>
table . .ok 1,0<BR>
table . .cancel 1,1<BR>
</CODE><P>Two buttons <I>.ok</I> and <I>.cancel</I> are now packed into the second row of the table.
They each occupy one cell of the table. By default, widgets span only
a single row and column. <P>
The first column contains two widgets, <I>.title</I> and
<I>.ok</I>. By default, the widest of the two widgets will define the width of
the column. However, we want <I>.title</I> to be centered horizontally along the
top of the table. We can make <I>.title</I> span two columns using the <B>configure</B>
operation. <BR>
<CODE># Make the label span both columns<BR>
table configure . .title -cspan 2<BR>
</CODE><P>The label <I>.title</I> will now be centered along the top row of the table. <P>
In
the above example, we've create and arranged the layout for the table invoking
the <B>table</B> command several times. Alternately, we could have used a single
<B>table</B> command. <BR>
<CODE>label .title -text "This is a title"<BR>
button .ok -text "Ok"<BR>
button .cancel -text "Cancel"<BR>
<P>
# Create and pack the table<BR>
table . \<BR>
.title 0,0 -cspan 2 \<BR>
.ok 1,0 \<BR>
.cancel 1,1<BR>
</CODE><P>The table will override the requested width and height of the container
so that the window fits the table exactly. This also means that any change
to the size of table will be propagated up through the Tk window hierarchy.
This feature can be turned off using the <B>configure</B> operation again. <BR>
<CODE>table configure . -propagate no<BR>
</CODE><P>You can also set the width of height of the table to a specific value. This
supersedes the calculated table size. <BR>
<CODE># Make the container 4 inches wide, 3 inches high<BR>
table configure . -reqwidth 4i -reqheight 3i<BR>
</CODE><P>If a widget is smaller than the cell(s) it occupies, the widget will float
within the extra space. By default, the widget will be centered within
the space, but you can anchor the widget to any side of cell using the
<B>-anchor</B> configuration option. <BR>
<CODE>table configure . .ok -anchor w<BR>
</CODE><P>The <B>-fill</B> option expands the widget to fill the extra space either vertically
or horizontally (or both). <BR>
<CODE># Make the title label fill the entire top row<BR>
table configure . .title -cspan 2 -fill x <BR>
<P>
# Each button will be as height of the 2nd row.<BR>
table configure . .ok .cancel -fill y<BR>
</CODE><P>The width of <I>.title</I> will be the combined widths of both columns. Both <I>.ok</I>
and <I>.cancel</I> will become as tall as the second row. <P>
The <B>-padx</B> and <B>-pady</B> options
control the amount of padding around the widget. Both options take a list
of one or two values. <BR>
<CODE># Pad the title by two pixels above and below.<BR>
table configure . .title -pady 2<BR>
<P>
# Pad each button 2 pixels on the left, and 4 on the right.<BR>
table configure . .ok .cancel -padx { 2 4 }<BR>
</CODE><P>If the list has only one value, then both exterior sides (top and bottom
or left and right) of the widget are padded by that amount. If the list
has two elements, the first specifies padding for the top or left side
and the second for the bottom or right side. <P>
Like the container, you can
also override the requested widths and heights of widgets using the <B>-reqwidth</B>
and <B>-reqheight</B> options. This is especially useful with character-based widgets
(such as buttons, labels, text, listbox, etc) that let you specify their
size only in units of characters and lines, instead of pixels. <BR>
<CODE># Make all buttons one inch wide<BR>
table configure . .ok .cancel -reqwidth 1i<BR>
<P>
</CODE><P>Each row and column of the table can be configured, again using the <B>configure</B>
operation. Rows are and columns are designated by <I>R<I>i</I></I> and <I>C<I>i</I></I> respectively,
where <I>i</I> is the index of the row or column. <P>
For example, you can set the
size of a row or column. <BR>
<CODE># Make the 1st column 2 inches wide<BR>
table configure . c0 -width 2.0i<BR>
<P>
# Make the 2nd row 1/2 inch high.<BR>
table configure . r1 -height 0.5i<BR>
</CODE><P>The new size for the row or column overrides its calculated size. If no
widgets span the row or column, its height or width is zero. So you can
use the <B>-width</B> and <B>-height</B> options to create empty spaces in the table. <BR>
<CODE># Create an empty row and column<BR>
table configure . r2 c2 -width 1i<BR>
</CODE><P>The <B>-pady</B> option lets you add padding to the top and bottom sides of rows.
The <B>-padx</B> option adds padding to the left and right sides of columns. Both
options take a list of one or two values. <BR>
<CODE># Pad above the title by two pixels <BR>
table configure . r0 -pady { 2 0 }<BR>
<P>
# Pad each column 4 pixels on the left, and 2 on the right.<BR>
table configure . c* -padx { 2 4 }<BR>
<P>
</CODE><P>Notice that you can configure all the rows and columns using either <I>R*</I>
or <I>C*</I>. <P>
When the container is resized, the rows and columns of the table
are also resized. Only the rows or columns that contain widgets (a widget
spans the row or column) grow or shrink. The <B>-resize</B> option indicates whether
the row or column can be shrunk or stretched. If the value is <I>shrink</I>, the
row or column can only be resized smaller. If <I>expand</I>, it can only be resized
larger. If <I>none</I>, the row or column is frozen at its requested size. <BR>
<CODE># Let the 1st column get smaller, but not bigger<BR>
table configure . c0 -resize shrink<BR>
<P>
# Let the 2nd column get bigger, not smaller<BR>
table configure . c1 -resize expand<BR>
<P>
# Don't resize the first row <BR>
table configure . r0 -resize none<BR>
</CODE><P>The following example packs a canvas, two scrollbars, and a title. The rows
and columns containing the scrollbars are frozen at their requested size,
so that even if the frame is resized, the scrollbars will remain the same
width. <BR>
<CODE>table . \<BR>
.title 0,0 -cspan 3 \<BR>
.canvas 1,1 -fill both \<BR>
.vscroll 1,2 -fill y \<BR>
.hscroll 2,1 -fill x<BR>
<P>
# Don't let the scrollbars resize<BR>
table configure . c2 r2 -resize none<BR>
<P>
# Create an empty space to balance the scrollbar<BR>
table configure . c0 -width .vscroll<BR>
</CODE><P>Note that the value of the <B>-width</B> option is the name of a widget window.
This indicates that the width of the column should be the same as the
requested width of <I>.vscroll</I>. <P>
Finally, the <B>forget</B> operation removes widgets
from the table. <BR>
<CODE># Remove the windows from the table<BR>
table forget .quit .frame<BR>
</CODE><P>It's not necessary to specify the container. The <B>table</B> command determines
the container from the widget name.
<H2><A NAME="sect5" HREF="#toc5">Operations</A></H2>
The following operations are
available for the <B>table</B>:
<DL>
<DT><B>table <I>container</I></B> ?<I>widget index option value</I>?...
</DT>
<DD>Adds the widget <I>widget</I> to the table at <I>index</I>. <I>Index</I> is a row,column position
in the table. It must be in the form <I>row</I>,<I>column</I> where <I>row</I> and <I>column</I> are
the respective row and column numbers, starting from zero (0,0 is the upper
leftmost position). <I>Row</I> and <I>column</I> may also be numeric expressions that
are recursively evaluated. If a table doesn't exist for <I>container</I>, one is
created. <I>Widget</I> is the path name of the window, that must already exist,
to be arranged inside of <I>container</I>. <I>Option</I> and <I>value</I> are described in the
<FONT SIZE=-1><B>WIDGET</B></FONT>
section. </DD>
<DT><B>table arrange</B> <I>container</I> </DT>
<DD>Forces the table to compute its
layout immediately. Normally, the table geometry manager will wait until
the next idle point, before calculating the size of its rows and columns.
This is useful for collecting the <I>normal</I> sizes of rows and columns, that
are based upon the requested widget sizes. </DD>
<DT><B>table cget</B> <I>container </I>?<I>item</I>?<I> option</I>
</DT>
<DD>Returns the current value of the configuration option specific to <I>item</I>
given by <I>option</I>. <I>Item</I> is either a row or column index, or the path name
of a widget. <I>Item</I> can be in any form describe in the <B>configure</B> operation
below. If no <I>item</I> argument is provided, then the configuration option is
for the table itself. <I>Option</I> may be any one of the options described in
the appropriate section for <I>item</I>. </DD>
<DT><B>table configure</B> <I>container item</I>... ?<I>option
value</I>?... </DT>
<DD>Queries or modifies the configuration options specific to <I>item</I>.
If no <I>option</I> is specified, this command returns a list describing all of
the available options for <I>item</I> If the argument <I>item</I> is omitted, then the
specified configuration options are for the table itself. Otherwise <I>item</I>
must be either a row or column specification, or the path name of a widget.
The following <I>item</I> types are available. <blockquote></DD>
<DT><I>C<I>i</I></I> </DT>
<DD>Specifies the column of <I>container</I>
to be configured. <I>Item</I> must be in the form <I>C<I>n</I></I>, where <I>i</I> is the index of
the column. See the <FONT SIZE=-1><B>COLUMN</B></FONT>
section. </DD>
<DT><I>R<I>i</I></I> </DT>
<DD>Specifies the row of <I>container</I>
to be configured. <I>Item</I> must be in the form <I>R<I>i</I></I>, where <I>i</I> is the index of the
row. See the <FONT SIZE=-1><B>ROW</B></FONT>
section. </DD>
<DT><I>widget</I> </DT>
<DD>Specifies a widget of <I>container</I> to be
queried. <I>Widget</I> is the path name of a widget packed in <I>container</I>. See the
<FONT SIZE=-1><B>WIDGET</B></FONT>
section. </DD>
<DT>No argument </DT>
<DD>Specifies that the table itself is to be queried.
See the <FONT SIZE=-1><B>TABLE</B></FONT>
section for a description of the option-value pairs for
the table. </DD>
</DL>
</blockquote>
<blockquote><P>
The <I>option<I> and <I>value</I></I></I> pairs are specific to <I>item</I>. If <I>option</I> is
specified with no <I>value</I>, 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 <I>option</I> is specified). If one or more <I>option-value</I>
pairs are specified, then the command modifies the given option(s) to have
the given value(s); in this case the command returns the empty string. </blockquote>
<DL>
<DT><B>table
extents <I>container</I></B> <I>index</I> </DT>
<DD>Queries the location and dimensions of row and
columns in the table. <I>Index</I> can be either a row or column index or a table
index. Returns a list of the x,y coordinates (upperleft corner) and dimensions
(width and height) of the cell, row, or column. </DD>
<DT><B>table forget <I>widget</I></B> ?<I>widget</I>?...
</DT>
<DD>Requests that <I>widget</I> no longer have its geometry managed. <I>Widget</I> is the
pathname of the window currently managed by some table. The window will
be unmapped so that it no longer appears on the screen. If <I>widget</I> is not
currently managed by any table, an error message is returned, otherwise
the empty string. </DD>
<DT><B>table info <I>container</I></B> <I>item</I> </DT>
<DD>Returns a list of the current
configuration options for <I>item</I>. The list returned is exactly in the form
that might be specified to the <B>table</B> command. It can be used to save and
reset table configurations. <I>Item</I> must be one of the following. <blockquote></DD>
<DT><I>C<I>i</I></I> </DT>
<DD>Specifies
the column of <I>container</I> to be queried. <I>Item</I> must be in the form <I>C<I>n</I></I>, where
<I>n</I> is the index of the column. </DD>
<DT><I>R<I>i</I></I> </DT>
<DD>Specifies the row of <I>container</I> to be
queried. <I>Item</I> must be in the form <I>R<I>i</I></I>, where <I>i</I> is the index of the row.
</DD>
<DT><I>widget</I> </DT>
<DD>Specifies a widget of <I>container</I> to be queried. <I>Widget</I> is the path
name of a widget packed in <I>container</I>. </DD>
<DT>No argument </DT>
<DD>Specifies that the table
itself is to be queried. </DD>
</DL>
</blockquote>
<DL>
<DT><B>table locate <I>container</I></B> <I>x y</I> </DT>
<DD>Returns the table index
(row,column) of the cell containing the given screen coordinates. The <I>x</I>
and <I>y</I> arguments represent the x and y coordinates of the sample point to
be tested. </DD>
<DT><B>table containers </B>?<I>switch arg</I>? </DT>
<DD>Returns a list of all container
windows matching a given criteria (using <I>switch</I> and <I>arg</I>). If no <I>switch</I>
and <I>arg</I> arguments are given, the names of all container windows (only those
using the <B>table</B> command) are returned. The following are valid switches:
<blockquote></DD>
<DT><B>-pattern</B> <I>pattern</I> </DT>
<DD>Returns a list of pathnames of all container windows matching
<I>pattern</I>. </DD>
<DT><B>-slave</B> <I>window</I> </DT>
<DD>Returns the name of the container window of table
managing <I>window</I>. <I>Window</I> must be the path name of widget. If <I>window</I> is not
managed by any table, the empty string is returned. </DD>
</DL>
</blockquote>
<DL>
<DT><B>table search <I>container</I></B>
?<I>switch arg</I>?... </DT>
<DD>Returns the names of all the widgets in <I>container</I> matching
the criteria given by <I>switch</I> and <I>arg</I>. <I>Container</I> is name of the container
window associated with the table to be searched. The name of the widget
is returned if any one <I>switch</I>-<I>arg</I> criteria matches. If no <I>switch</I>-<I>arg</I> arguments
are given, the names of all widgets managed by <I>container</I> are returned.
The following are switches are available: <blockquote></DD>
<DT><B>-pattern</B> <I>pattern</I> </DT>
<DD>Returns the names
of any names of the widgets matching <I>pattern</I>. </DD>
<DT><B>-span</B> <I>index</I> </DT>
<DD>Returns the
names of widgets that span <I>index</I>. A widget does not need to start at <I>index</I>
to be included. <I>Index</I> must be in the form <I>row</I>,<I>column</I>, where <I>row</I> and <I>column</I>
are valid row and column numbers. </DD>
<DT><B>-start</B> <I>index</I> </DT>
<DD>Returns the names of widgets
that start at <I>index</I>. <I>Index</I> must be in the form <I>row</I>,<I>column</I>, where <I>row</I> and
<I>column</I> are valid row and column numbers. </DD>
</DL>
</blockquote>
<H2><A NAME="sect6" HREF="#toc6">Table Options</A></H2>
To configure the table
itself, you omit the <I>item</I> argument when invoking the <B>configure</B> operation.
<BR>
<CODE><B>table configure</B> <I>container</I> ?<I>option value</I>?...<BR>
</CODE><P>The following options are available for the table: <blockquote>
<DL>
<DT><B>-padx <I>pad</I></B> </DT>
<DD>Sets how much
padding to add to the left and right exteriors of the table. <I>Pad</I> can be
a list of one or two numbers. If <I>pad</I> has two elements, the left side of
the table is padded by the first value and the right side by the second
value. If <I>pad</I> has just one value, both the left and right sides are padded
evenly by the value. The default is <I>0</I>. </DD>
<DT><B>-pady <I>pad</I></B> </DT>
<DD>Sets how much padding to
add to the top and bottom exteriors of the table. <I>Pad</I> can be a list of one
or two numbers. If <I>pad</I> has two elements, the area above the table is padded
by the first value and the area below by the second value. If <I>pad</I> is just
one number, both the top and bottom areas are padded by the value. The
default is <I>0</I>. </DD>
<DT><B>-propagate <I>boolean</I></B> </DT>
<DD>Indicates if the table should override
the requested width and height of the <I>container</I> window. If <I>boolean</I> is false,
<I>container</I> will not be resized. <I>Container</I> will be its requested size. The
default is <I>1</I>. </DD>
</DL>
</blockquote>
<H2><A NAME="sect7" HREF="#toc7">Widget Options</A></H2>
widgets are configured by specifying the name
of the widget when invoking the <B>configure</B> operation. <BR>
<P>
<CODE><B>table configure</B> <I>container <I>widget</I></I> ?<I>option value</I>?...<BR>
</CODE><P><I>Widget</I> must be the path name of a window already packed in the table associated
with <I>container</I>. The following options are available for widgets: <blockquote>
<DL>
<DT><B>-anchor
<I>anchor</I></B> </DT>
<DD>Anchors <I>widget</I> to a particular edge of the cell(s) it resides. This
option has effect only if the space of the spans surrounding <I>widget</I> is
larger than <I>widget</I>. <I>Anchor</I> specifies how <I>widget</I> will be positioned in the
space. For example, if <I>anchor</I> is <I>center</I> then the window is centered in
the rows and columns it spans; if <I>anchor</I> is <I>w</I> then the window will be aligned
with the leftmost edge of the span. The default is <I>center</I>. </DD>
<DT><B>-columnspan <I>number</I></B>
</DT>
<DD>Sets the number of columns <I>widget</I> will span. The default is <I>1</I>. </DD>
<DT><B>-columncontrol
<I>control</I></B> </DT>
<DD>Specifies how the width of <I>widget</I> should control the width of the
columns it spans. <I>Control</I> is either <I>normal</I>, <I>none</I>, or <I>full</I>. The default
is <I>normal</I>. <blockquote></DD>
<DT><I>none</I> </DT>
<DD>The width of <I>widget</I> is not considered. </DD>
<DT><I>full</I> </DT>
<DD>Only the width
of <I>widget</I> will be considered when computing the widths of the columns.
</DD>
<DT><I>normal</I> </DT>
<DD>Indicates that the widest widget spanning the column will determine
the width of the span. </DD>
</DL>
</blockquote>
<DL>
<DT><B>-fill <I>fill</I></B> </DT>
<DD>Specifies if <I>widget</I> should be stretched
to fill any free space in the span surrounding <I>widget</I>. <I>Fill</I> is either <I>none</I>,
<I>x</I>, <I>y</I>, <I>both</I>. The default is <I>none</I>. <blockquote></DD>
<DT><I>x</I> </DT>
<DD>The widget can grow horizontally. </DD>
<DT><I>y</I>
</DT>
<DD>The widget can grow vertically. </DD>
<DT><I>both</I> </DT>
<DD>The widget can grow both vertically
and horizontally. </DD>
<DT><I>none</I> </DT>
<DD>The widget does not grow along with the span.
</DD>
</DL>
</blockquote>
<DL>
<DT><B>-ipadx <I>pixels</I></B> </DT>
<DD>Sets how much horizontal padding to add internally on the
left and right sides of <I>widget</I>. <I>Pixels</I> must be a valid screen distance
like <I>2</I> or <I>0.3i</I>. The default is <I>0</I>. </DD>
<DT><B>-ipady <I>pixels</I></B> </DT>
<DD>Sets how much vertical padding
to add internally on the top and bottom of <I>widget</I>. <I>Pixels</I> must be a valid
screen distance like <I>2</I> or <I>0.3i</I>. The default is <I>0</I>. </DD>
<DT><B>-padx <I>pad</I></B> </DT>
<DD>Sets how much
padding to add to the left and right exteriors of <I>widget</I>. <I>Pad</I> can be a list
of one or two numbers. If <I>pad</I> has two elements, the left side of <I>widget</I>
is padded by the first value and the right side by the second value. If
<I>pad</I> has just one value, both the left and right sides are padded evenly
by the value. The default is <I>0</I>. </DD>
<DT><B>-pady <I>pad</I></B> </DT>
<DD>Sets how much padding to add to
the top and bottom exteriors of <I>widget</I>. <I>Pad</I> can be a list of one or two
numbers. If <I>pad</I> has two elements, the area above <I>widget</I> is padded by the
first value and the area below by the second value. If <I>pad</I> is just one
number, both the top and bottom areas are padded by the value. The default
is <I>0</I>. </DD>
<DT><B>-reqheight <I>height</I></B> </DT>
<DD>Specifies the limits of the requested height for
<I>widget</I>. <I>Height</I> is a list of bounding values. See the <FONT SIZE=-1><B>BOUNDING</B></FONT>
section
for a description of this list. By default, the height of <I>widget</I> is its
requested height with its internal padding (see the <B>-ipady</B> option). The
bounds specified by <I>height</I> either override the height completely, or bound
the height between two sizes. The default is <I>""</I>. </DD>
<DT><B>-reqwidth <I>width</I></B> </DT>
<DD>Specifies
the limits of the requested width for <I>widget</I>. <I>Width</I> is a list of bounding
values. See the <FONT SIZE=-1><B>BOUNDING</B></FONT>
section for a description of this list. By default,
the width of <I>widget</I> is its requested width with its internal padding (set
the <B>-ipadx</B> option). The bounds specified by <I>width</I> either override the width
completely, or bound the height between two sizes. The default is <I>""</I>. </DD>
<DT><B>-rowspan
<I>number</I></B> </DT>
<DD>Sets the number of rows <I>widget</I> will span. The default is <I>1</I>. </DD>
<DT><B>-rowcontrol
<I>control</I></B> </DT>
<DD>Specifies how the height of <I>widget</I> should control the height of
the rows it spans. <I>Control</I> is either <I>normal</I>, <I>none</I>, or <I>full</I>. The default
is <I>normal</I>. <blockquote></DD>
<DT><I>none</I> </DT>
<DD>The height of <I>widget</I> is not considered. </DD>
<DT><I>full</I> </DT>
<DD>Only the
height of <I>widget</I> will be considered when computing the heights of the rows.
</DD>
<DT><I>normal</I> </DT>
<DD>Indicates that the tallest widget spanning the row will determine
the height of the span. </DD>
</DL>
</blockquote>
</blockquote>
<H2><A NAME="sect8" HREF="#toc8">Column Options</A></H2>
To configure a column in the table,
specify the column index as <I>C<I>i</I></I>, where <I>i</I> is the index of the column to be
configured. <BR>
<P>
<CODE><B>table configure</B> <I>container <I>C<I>i</I></I></I> ?<I>option value</I>?...<BR>
</CODE><P>If the index is specified as <I>C*</I>, then all columns of the table will be
configured. The following options are available for table columns. <blockquote>
<DL>
<DT><B>-padx
<I>pad</I></B> </DT>
<DD>Sets the padding to the left and right of the column. <I>Pad</I> can be a list
of one or two numbers. If <I>pad</I> has two elements, the left side of the column
is padded by the first value and the right side by the second value. If
<I>pad</I> has just one value, both the left and right sides are padded evenly
by the value. The default is <I>0</I>. </DD>
<DT><B>-resize <I>mode</I></B> </DT>
<DD>Indicates that the column can
expand or shrink from its requested width when the table is resized. <I>Mode</I>
must be one of the following: <I>none</I>, <I>expand</I>, <I>shrink</I>, or <I>both</I>. If <I>mode</I> is
<I>expand</I> the width of the column is expanded if there is extra space in
the container window. If <I>mode</I> is <I>shrink</I> its width may be reduced beyond
its requested width if there is not enough space in the container. The default
is <I>none</I>. </DD>
<DT><B>-width <I>width</I></B> </DT>
<DD>Specifies the limits within that the width of the column
may expand or shrink. <I>Width</I> is a list of bounding values. See the section
<FONT SIZE=-1><B>BOUNDING</B></FONT>
for a description of this list. By default there are no constraints.
</DD>
</DL>
</blockquote>
<H2><A NAME="sect9" HREF="#toc9">Row Options</A></H2>
To configure a row in the table, specify the row index as <I>R<I>i</I></I>,
where <I>i</I> is the index of the row to be configured. <BR>
<P>
<CODE><B>table configure</B> <I>container <I>R<I>i</I></I></I> ?<I>option value</I>?...<BR>
</CODE><P>If the index is specified as <I>R*</I>, then all rows of the table will be configured.
The following options are available for table rows. <blockquote>
<DL>
<DT><B>-height <I>height</I></B> </DT>
<DD>Specifies
the limits of the height that the row may expand or shrink to. <I>Height</I> is
a list of bounding values. See the section <FONT SIZE=-1><B>BOUNDING</B></FONT>
for a description
of this list. By default there are no constraints. </DD>
<DT><B>-pady <I>pad</I></B> </DT>
<DD>Sets the padding
above and below the row. <I>Pad</I> can be a list of one or two numbers. If <I>pad</I>
has two elements, the area above the row is padded by the first value and
the area below by the second value. If <I>pad</I> is just one number, both the
top and bottom areas are padded by the value. The default is <I>0</I>. </DD>
<DT><B>-resize <I>mode</I></B>
</DT>
<DD>Indicates that the row can expand or shrink from its requested height
when the table is resized. <I>Mode</I> must be one of the following: <I>none</I>, <I>expand</I>,
<I>shrink</I>, or <I>both</I>. If <I>mode</I> is <I>expand</I> the height of the row is expanded if
there is extra space in the container. If <I>mode</I> is <I>shrink</I> its height may
be reduced beyond its requested height if there is not enough space in
the container. The default is <I>none</I>. </DD>
</DL>
</blockquote>
<H2><A NAME="sect10" HREF="#toc10">Bounding Sizes</A></H2>
Sometimes it's more useful
to limit resizes to an acceptable range, than to fix the size to a particular
value or disallow resizing altogether. Similar to the way the <B>wm</B> command
lets you specify a <B>minsize</B> and <B>maxsize</B> for a toplevel window, you can bound
the sizes the container, a widget, row, or column may take. The <B>-width</B>, <B>-height</B>,
<B>-reqwidth</B>, and <B>-reqheight</B> options, take a list of one, two, or three values.
We can take a previous example and instead preventing resizing, bound the
size of the scrollbars between two values. <BR>
<CODE>table . \<BR>
.title 0,0 -cspan 3 \<BR>
.canvas 1,1 -fill both \<BR>
.vscroll 1,2 -fill y \<BR>
.hscroll 2,1 -fill x<BR>
<P>
# Bound the scrollbars between 1/8 and 1/2 inch<BR>
table configure . c2 -width { 0.125 0.5 }<BR>
table configure . r2 -height { 0.125 0.5 }<BR>
table configure . vscroll .hscroll -fill both<BR>
</CODE><P>The scrollbars will get no smaller than 1/8 of an inch, or bigger than
1/2 inch. The initial size will be their requested size, so long as it
is within the specified bounds. <P>
How the elements of the list are interpreted
is dependent upon the number of elements in the list. <blockquote>
<DL>
<DT>{<I></I>} </DT>
<DD>Empty list. No
bounds are set. The default sizing is performed. </DD>
<DT>{<I> x </I>} </DT>
<DD>Fixes the size to
<I>x</I>. The window or partition cannot grow or shrink. </DD>
<DT>{<I> min max </I>} </DT>
<DD>Sets up minimum
and maximum limits for the size of the window or partition. The window
or partition can be reduced less than <I>min</I>, nor can it be stretched beyond
<I>max</I>. </DD>
<DT>{<I> min max nom </I>} </DT>
<DD>Specifies minimum and maximum size limits, but also
specifies a nominal size <I>nom</I>. This overrides the calculated size of the
window or partition. </DD>
</DL>
</blockquote>
<H2><A NAME="sect11" HREF="#toc11">Miscellaneous</A></H2>
Another feature is that you can put two
widgets in the same cell of the table. This is useful when you want to
add decorations around a widget. <BR>
<CODE>frame .frame -bd 1 -relief sunken<BR>
button .quit -text "Quit"<BR>
<P>
# Put both the frame and the button in the same cell.<BR>
table . \<BR>
.quit 1,0 -padx 2 -pady 2 \<BR>
.frame 1,0 -fill both<BR>
<H2><A NAME="sect12" HREF="#toc12"></CODE><P>Limitations</A></H2>
A long standing bug in Tk (circa 1993), there is no way to detect
if a window is already a container of a different geometry manager. This
is usually done by accident, such as the following where all three widgets
are arranged in the same container ".", but using different geometry managers.
<BR>
<CODE> table .f1<BR>
<tt> </tt> <tt> </tt> ...<BR>
pack .f2<BR>
<tt> </tt> <tt> </tt> ...<BR>
grid .f3<BR>
</CODE><P>This leads to bizarre window resizing, as each geometry manager applies
its own brand of layout policies. When the container is a top level window
(such as "."), your window manager may become locked as it responds to the
never-ending stream of resize requests.
<H2><A NAME="sect13" HREF="#toc13">Keywords</A></H2>
frame, geometry manager,
location, table, size <P>
<P>
<HR><P>
<A NAME="toc"><B>Table of Contents</B></A><P>
<UL>
<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
<LI><A NAME="toc4" HREF="#sect4">Example</A></LI>
<LI><A NAME="toc5" HREF="#sect5">Operations</A></LI>
<LI><A NAME="toc6" HREF="#sect6">Table Options</A></LI>
<LI><A NAME="toc7" HREF="#sect7">Widget Options</A></LI>
<LI><A NAME="toc8" HREF="#sect8">Column Options</A></LI>
<LI><A NAME="toc9" HREF="#sect9">Row Options</A></LI>
<LI><A NAME="toc10" HREF="#sect10">Bounding Sizes</A></LI>
<LI><A NAME="toc11" HREF="#sect11">Miscellaneous</A></LI>
<LI><A NAME="toc12" HREF="#sect12">Limitations</A></LI>
<LI><A NAME="toc13" HREF="#sect13">Keywords</A></LI>
</UL>
</BODY></HTML>
|