Michael Krause > Tk-MK > Tk::HListplus

Download:
Tk-MK-0.23.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.6   Source  

NAME ^

Tk::HListplus - A HList that supports resizing, open & close of columns

SYNOPSIS ^

    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;

DESCRIPTION ^

A HList derived widget that has resizable columns, based on Header-ResizeButtons.

METHODS ^

headerCreate()

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:

headerCget()

This command allows with -widget to retrieve the Headerbutton-Widget Reference.

OPTIONS ^

-command

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.

-activebackground

The background color used for the column Header during active state (Mouse over Header).

-activeforeground

The foreground color used for the column Header during active state (Mouse over Header).

-buttondownrelief

The relief used for the column Header Button during selected state (Button pressed).

-minwidth

The minwidth is used for the specific column (during resize), default: 30.

-closedminwidth

The closedminwidth is used for the specific column (while in "CLOSED" view), default: 10.

-resizerwidth

The resizerwidth is the resize sensor-area on the right border of the specific column, default: 1.

-headerstyle

An alternative Header style, which will be the default for all columns unless you specify -style ... for a dedicated header-create() call column.

AUTHORS ^

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

syntax highlighting: