Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Some beginning Tk help

by dree (Monsignor)
on Jun 22, 2002 at 18:48 UTC ( [id://176508]=note: print w/replies, xml ) Need Help??


in reply to Some beginning Tk help

You have to bind the <Configure> event and then resize the window:
$mw->bind('<Configure>', \&Window_Resize);

This should work for you:
#!/usr/bin/perl use lib 'C:\MyPerlLib'; use Tk; use Tk::Pane; my $i = 0; my $mw = MainWindow->new( -title => "SACL Survey" ); my $pane = $mw->Scrolled(qw/Pane -scrollbars osw/)->grid(); my $label=$mw->Label( -text => "... <insert directions here> ..." )- +>grid(); for (1..30) { $pane->Radiobutton( -text => "1", -value => "1", -justify => "left", -variable => \${"rb1_q$_"}, )->grid( $pane->Radiobutton( -text => "2", -value => "2", -justify => "left", -variable => \${"rb2_q$_"}, ), $pane->Radiobutton( -text => "3", -value => "3", -justify => "left", -variable => \${"rb3_q$_"}, ), $pane->Radiobutton( -text => "4", -value => "4", -justify => "left", -variable => \${"rb4_q$_"}, )); } $mw->bind('<Configure>', \&Window_Resize); MainLoop; sub Window_Resize { my $e = $mw->XEvent; return if !$e; my $mww=$mw->width; my $mwh=$mw->height; $pane->place( -height => $mwh-30, -width => $mww-20); $label->place(-y=>$mwh-20,-x=>$mww/2-70); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://176508]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-16 21:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found