Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Some beginning Tk help

by dree (Monsignor)
on Jun 22, 2002 at 18:48 UTC ( #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); }

Comment on Re: Some beginning Tk help
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2016-02-07 11:33 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (251 votes), past polls