Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Help: Disappearing Tk::Adjuster

by cmv (Chaplain)
on Mar 17, 2010 at 17:00 UTC ( #829223=perlquestion: print w/replies, xml ) Need Help??
cmv has asked for the wisdom of the Perl Monks concerning the following question:

Wise Monks-

I have need to create 2 widgets - one on top of the other. The bottom one's size needs to optionally be adjustable by the user. I want the adjuster to be in between the 2 widgets. When the whole window is resized, only the top widget should get bigger/smaller.

I've created a test case that does everything I want, but there is a bad side-effect. If you simply run this code, and move the adjuster up high enough - it disappears!

Can you help me find a way to make it stop doing that?



use strict; use warnings; use Tk; use Tk::Adjuster; my $t = MainWindow->new; my $f = $t->Frame(-background=>'green')-> pack(-expand=>1, -fill=>'both'); my $w1 = $f->Listbox(-background=>'blue')-> pack(-fill=>'both', -expand=>1, -anchor=>'n'); my $w2 = $f->Listbox(-background=>'yellow', -height=>3)-> pack(-side=>'bottom', -fill=>'both', -expand=>1, -anchor=>'n'); my $adj1 = $f->Adjuster(); $adj1->packAfter($w2, -side=>'bottom'); MainLoop;

Replies are listed 'Best First'.
Re: Help: Disappearing Tk::Adjuster
by stefbv (Deacon) on Mar 17, 2010 at 18:17 UTC

    This might work:

    use strict; use warnings; use Tk; use Tk::Adjuster; my $t = MainWindow->new; my $w1 = $t->Listbox(-background => 'yellow', -height => 3,); my $adj1 = $t->Adjuster(); my $w2 = $t->Listbox(-background => 'blue'); $w1->pack(-side => 'bottom', -fill => 'both', -expand => 1); $adj1->packAfter($w1, -side => 'bottom'); $w2->pack(-side => 'bottom', -fill => 'both', -expand => 1); MainLoop;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://829223]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2017-01-23 20:26 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (195 votes). Check out past polls.