Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone know if it's possible to have an expandable, and collapsable HList?
use Tk::HList; my $mw = MainWindow->new(); my $label = $mw->Label(-width=>15); my $hlist = $mw->HList( -itemtype => 'text', -separator => '/', -selectmode => 'single', -browsecmd => sub { my $file = shift; $label->configure(-text=>$file); } ); foreach ( qw(/ /home /home/ioi /home/foo /usr /usr/lib) ) { $hlist->add($_, -text=>$_); } $hlist->pack; $label->pack; MainLoop;
This branches in this code can't be expanded

Replies are listed 'Best First'.
Re: HList Expand, and collapse?
by jasonk (Parson) on Mar 19, 2003 at 19:26 UTC

    Tk::Tree is a subclass of HList that does what you are looking for.


    We're not surrounded, we're in a target-rich environment!

      I have got to take my Perl/Tk knowledge beyond the "Learning Perl/Tk" book. There is so much stuff that I have no idea about, and it's part of the pTk default bundle?

      ++jasonk for reminding me of that.


      I just realized that I was using the same sig for nearly three years.

        and it's part of the pTk default bundle?

        Did you click the link? Go ahead and do it. Click the Tk::Tree link and find out.


        MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
        I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
        ** The Third rule of perl club is a statement of fact: pod is sexy.