home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _ab02fd4a775a9f91fcd0f74ae222a4ee < prev    next >
Text File  |  2004-06-01  |  2KB  |  93 lines

  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. If I<$widget> is not a reference it is treated as a string, and
  47. a Lable widget is created with the string as its text.
  48.  
  49. All the widgets in each column are set to the same width - the requested
  50. width of the widest widget in the column.
  51. Likewise, all the widgets in each row are set to the same height - the requested
  52. height of the tallest widget in the column.
  53.  
  54. A number of rows and/or columns can be marked as 'fixed' - and so can serve
  55. as 'headings' for the remainder the rows which are scrollable.
  56.  
  57. The requested size of the table as a whole is such that the number of rows
  58. specified by -rows (default 10), and number of columns specified by -columns
  59. (default 10) can be displayed.
  60.  
  61. If the Table is told it can take the keyboard focus then cursor and scroll
  62. keys scroll the displayed widgets.
  63.  
  64. The Table will create and manage its own scrollbars if requested via
  65. -scrollbars.
  66.  
  67. The table can be emptied using
  68.  
  69.  $table->clear
  70.  
  71. the widgets which were in the table are destroyed.
  72.  
  73.  
  74. The Tk::Table widget is derived from a Tk::Frame, so inherits all its
  75. configure options.
  76.  
  77. =head1 BUGS / Snags / Possible enhancements
  78.  
  79. =over 4
  80.  
  81. =item *
  82.  
  83. Very large Tables consume a lot of X windows.
  84.  
  85. =item *
  86.  
  87. No equivalent of pack's -anchor/-pad etc. options
  88.  
  89. =back
  90.  
  91. =cut
  92.  
  93.