1Table(3) User Contributed Perl Documentation Table(3)
2
3
4
6 Tk::Table - Scrollable 2 dimensional table of Tk widgets
7
9 use Tk::Table;
10
11 $table = $parent->Table(-rows => number,
12 -columns => number,
13 -scrollbars => anchor,
14 -fixedrows => number,
15 -fixedcolumns => number,
16 -takefocus => boolean);
17
18 $widget = $table->Button(...);
19
20 $old = $table->put($row,$col,$widget);
21 $old = $table->put($row,$col,"Text"); # simple Label
22 $widget = $table->get($row,$col);
23
24 $cols = $table->totalColumns;
25 $rows = $table->totalRows;
26
27 $table->see($widget);
28 $table->see($row,$col);
29
30 ($row,$col) = $table->Posn($widget);
31
33 Tk::Table is an all-perl widget/geometry manager which allows a two
34 dimensional table of arbitary perl/Tk widgets to be displayed.
35
36 Entries in the Table are simply ordinary perl/Tk widgets. They should
37 be created with the Table as their parent. Widgets are positioned in
38 the table using:
39
40 $table->put($row,$col,$widget)
41
42 If $widget is not a reference it is treated as a string, and a Lable
43 widget is created with the string as its text.
44
45 All the widgets in each column are set to the same width - the
46 requested width of the widest widget in the column. Likewise, all the
47 widgets in each row are set to the same height - the requested height
48 of the tallest widget in the column.
49
50 A number of rows and/or columns can be marked as 'fixed' - and so can
51 serve as 'headings' for the remainder the rows which are scrollable.
52
53 The requested size of the table as a whole is such that the number of
54 rows specified by -rows (default 10), and number of columns specified
55 by -columns (default 10) can be displayed.
56
57 If the Table is told it can take the keyboard focus then cursor and
58 scroll keys scroll the displayed widgets.
59
60 "-scrollbars". By default, scrollbars will be added "nw". To disable
61 scrollbars, set "-scrollbars" to an empty string:
62
63 $table = $parent->Table(-scrollbars => '', ...);
64
65 The table can be emptied using
66
67 $table->clear
68
69 the widgets which were in the table are destroyed.
70
71 The Tk::Table widget is derived from a Tk::Frame, so inherits all its
72 configure options.
73
74 The default focus traversal is giving the focus only to the table
75 widget as a whole. To enable focus traversal into table cells (e.g. if
76 there are embedded entry widgets), then the option "-takefocus" has to
77 be set to 0.
78
80 · Very large Tables consume a lot of X windows.
81
82 · No equivalent of pack's -anchor/-pad etc. options
83
85 Tk::grid, Tk::HList, Tk::TableMatrix, Tk::MListbox, Tk::Columns
86
87
88
89perl v5.28.0 2018-07-15 Table(3)