TableMatrix...eetHideRows(3)
bestie, welcome to TableMatrix...eetHideRows(3) β the perl/Tk Documentation page for a widget that's genuinely iconic: a table display with selectable hide/un-hide of rows. Let's unpack it π
β¨ NAME β¨
Tk::TableMatrix::SpreadsheetHideRows β Table Display with selectable hide/un-hide of rows
π SYNOPSIS π
okay so here's the setup vibe check:
use Tk;
use Tk::TableMatrix::SpreadsheetHideRows
my $t = $top->Scrolled('SpreadsheetHideRows',
-selectorCol => 3,
-expandData => $hashRef,
-rows => 21, -cols => 11,
-width => 6, -height => 6,
-titlerows => 1, -titlecols => 1,
-variable => $arrayVar,
-selectmode => 'extended',
-resizeborders => 'both',
-bg => 'white',
);
π¦ DESCRIPTION π¦
Tk::TableMatrix::SpreadsheetHideRows is a Tk::TableMatrix::Spreadsheet-derived widget that implements a Spreadsheet-like display of tabular information, where some of the rows in the table can be expanded/hidden by clicking a '+/-' selector in the row. This can be used to display top-level information in a table, while allowing the user to expand certain table rows to view detail-level information.
See demos/SpreadsheetHideRows in the source distribution for a simple example of this widget π«Ά
πΈ Widget-specific Options πΈ
In addition to the standard Tk::TableMatrix widget options, the following options are implemented:
-selectorColβ Column number where the+/-selector will appear. Clicking on the+/-selector will expand/hide the detail information in the table for a particular row.-selectorColWidthβ Width of the column used to display the+/-selector. Defaults to2.-expandDataβ Hash ref defining the detail-level data displayed when a row is expanded (by clicking the+/-selector). This hash ref should have the following structure:
$expandData = {
row1 => { tag => 'detailDataTag',
data => $detailData,
spans=> $spanData,
expandData => $subLevelData
},
row2 => {
.
.
}
Where:
row1,row2, ... β Row numbers that will be expandable.tag => 'detailDataTag'β Tag name that will be applied to the detail data. (optional)$detailDataβ 2D Array of detail-data to be displayed when the row is expanded. e.g.
[ [ r1c1, r1c2, r1c3 ],
[ r2c1, r2c2, r2,c3] ]
$spansβ 1D array of span information (optional) to be used for display of the detail information. e.g.
[ col2 => "rows,cols", col4 => "rows,cols", ... ]
$subLevelDataβ Optional Recursive expandData used to hold detail-data of detail-data.
π MEMBER DATA π
The following items are stored as member data:
defaultCursor
Name of the mouse cursor pointer that is used for normal (i.e. non-title, non-indicator) cells in the widget. This is set to the value of the $widget->cget(-cursor) option when the widget is created.
indRowCols
Hash ref of Row/Cols indexes where the indicators live. This is a quick lookup hash built from _expandData.
_expandData
Internal version of the expandData hash. Any sub-detail data (i.e. expand data that is at lower levels of expandData) that is visible is placed at the top level of this hash, for keeping track of the visible expandData.
π Widget Methods π
In addition to the standard Tk::TableMatrix widget method, the following methods are implemented:
showDetail
Shows (i.e. expands the table) the detail data for a given row. This method is called when a user clicks on an indicator that is not already expanded.
Usage:
$widget->showDetail($row);
# Shows the detail data for row number $row
hideDetail
Hides the detail data for a given row. This method is called when a user clicks on an indicator that is already expanded.
Usage:
$widget->hideDetail($row);
# Hides the detail data for row number $row
that's the whole page, bestie π«Ά β it's from Tk1.29, dated 2023-05-11, and it's the TableMatrix...eetHideRows(3) page. periodt π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Tk-TableMatrix 1.29-bp160.1.13 Β· (Artistic-1.0 OR GPL-1.0-or-later) AND TCL
- opensuse-leap 16.0: perl-Tk-TableMatrix 1.29-bp160.1.13 Β· (Artistic-1.0 OR GPL-1.0-or-later) AND TCL
- opensuse-leap 16.0: perl-Tk-TableMatrix 1.29-bp160.1.13 Β· (Artistic-1.0 OR GPL-1.0-or-later) AND TCL
- opensuse-leap 16.0: perl-Tk-TableMatrix 1.29-bp160.1.13 Β· (Artistic-1.0 OR GPL-1.0-or-later) AND TCL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms