Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | |
2 | =head1 NAME | |
3 | ||
4 | Tk::Table - Scrollable 2 dimensional table of Tk widgets | |
5 | ||
6 | =for pm Tk/Table.pm | |
7 | ||
8 | =for category Tk Geometry Management | |
9 | ||
10 | =head1 SYNOPSIS | |
11 | ||
12 | use Tk::Table; | |
13 | ||
14 | $table = $parent->Table(-rows => number, | |
15 | -columns => number, | |
16 | -scrollbars => anchor, | |
17 | -fixedrows => number, | |
18 | -fixedcolumns => number, | |
19 | -takefocus => boolean); | |
20 | ||
21 | $widget = $table->Button(...); | |
22 | ||
23 | $old = $table->put($row,$col,$widget); | |
24 | $old = $table->put($row,$col,"Text"); # simple Label | |
25 | $widget = $table->get($row,$col); | |
26 | ||
27 | $cols = $table->totalColumns; | |
28 | $rows = $table->totalRows; | |
29 | ||
30 | $table->see($widget); | |
31 | $table->see($row,$col); | |
32 | ||
33 | ($row,$col) = $table->Posn($widget); | |
34 | ||
35 | =head1 DESCRIPTION | |
36 | ||
37 | Tk::Table is an all-perl widget/geometry manager which allows a two dimensional | |
38 | table of arbitary perl/Tk widgets to be displayed. | |
39 | ||
40 | Entries in the Table are simply ordinary perl/Tk widgets. They should | |
41 | be created with the Table as their parent. Widgets are positioned in the | |
42 | table using: | |
43 | ||
44 | $table->put($row,$col,$widget) | |
45 | ||
46 | All the widgets in each column are set to the same width - the requested | |
47 | width of the widest widget in the column. | |
48 | Likewise, all the widgets in each row are set to the same height - the requested | |
49 | height of the tallest widget in the column. | |
50 | ||
51 | A number of rows and/or columns can be marked as 'fixed' - and so can serve | |
52 | as 'headings' for the remainder the rows which are scrollable. | |
53 | ||
54 | The requested size of the table as a whole is such that the number of rows | |
55 | specified by -rows (default 10), and number of columns specified by -columns | |
56 | (default 10) can be displayed. | |
57 | ||
58 | If the Table is told it can take the keyboard focus then cursor and scroll | |
59 | keys scroll the displayed widgets. | |
60 | ||
61 | The Table will create and manage its own scrollbars if requested via | |
62 | -scrollbars. | |
63 | ||
64 | The Tk::Table widget is derived from a Tk::Frame, so inherits all its | |
65 | configure options. | |
66 | ||
67 | =head1 BUGS / Snags / Possible enhancements | |
68 | ||
69 | =over 4 | |
70 | ||
71 | =item * | |
72 | ||
73 | Very large Tables consume a lot of X windows | |
74 | ||
75 | =item * | |
76 | ||
77 | No equivalent of pack's -anchor/-pad etc. options | |
78 | ||
79 | =back | |
80 | ||
81 | =cut | |
82 |