Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Problems? Is your data what you think it is?
 
PerlMonks  

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?

Thanks

-Craig

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;

Comment on Help: Disappearing Tk::Adjuster
Download Code
Re: Help: Disappearing Tk::Adjuster
by stefbv (Chaplain) 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://829223]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-04-16 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (415 votes), past polls