Tk::HListplus - A HList that supports resizing, open & close of columns
use Tk; use Tk::HListplus; my $mw = MainWindow->new(); # CREATE HEADER STYLE 1 my $headerstyle1 = $mw->ItemStyle('window', -padx => 0, -pady => 0); # CREATE MY HLIST my $hlist = $mw->Scrolled('HListplus', -columns=>3, -header => 1, -headerstyle => $headerstyle1, )->pack(-side => 'left', -expand => 'yes', -fill => 'both'); # CREATE HEADER STYLE 2 my $headerstyle = $hlist->ItemStyle('window', -padx => 0, -pady => 0); $hlist->header('create', 0, -itemtype => 'resizebutton', -style => $headerstyle, -text => 'Test Name', -activeforeground => 'red', ); $hlist->header('create', 1, -itemtype => 'resizebutton', -style => $headerstyle, -text => 'Status', -activebackground => 'orange', ); Tk::MainLoop;
A HList derived widget that has resizable columns, based on Header-ResizeButtons.
The create command accepts a new, virtual itemtype 'resizebutton', which will lead to a Header-button with a right-side located sensor for resizing. All options suitable for Buttons apply.
In addition, the following options may be specified:
This command allows with -widget to retrieve the Headerbutton-Widget Reference.
The default command is associated with an open/close function for the selected column. The function is called with a Tk::HeaderResizeButton reference for custom usage.
The background color used for the column Header during active state (Mouse over Header).
The foreground color used for the column Header during active state (Mouse over Header).
The relief used for the column Header Button during selected state (Button pressed).
The minwidth is used for the specific column (during resize), default: 30.
The closedminwidth is used for the specific column (while in "CLOSED" view), default: 10.
The resizerwidth is the resize sensor-area on the right border of the specific column, default: 1.
An alternative Header style, which will be the default for all columns unless you specify -style ... for a dedicated header-create() call column.
Michael Krause, KrauseM_AT_gmx_DOT_net
Thanks for Tk::ResizeButton by Shaun Wandler <wandler@unixmail.compaq.com>, Slaven Rezic and Frank Herrmann.
This code may be distributed under the same conditions as Perl.
V0.4 (C) October 2006
To install Tk::DTree, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tk::DTree
CPAN shell
perl -MCPAN -e shell install Tk::DTree
For more information on module installation, please visit the detailed CPAN module installation guide.