http://qs321.pair.com?node_id=176490

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

I just started learning Perl/Tk today, and doing an example encountered a problem. (I'm using Mastering Perl/Tk, an O'reilly book, but it doesn't seem to address this)

I need to have 30 groups of 4 radio buttons (with values 1, 2, 3, and 4, respectively). This, however, takes up more than a screen, so I needed to use a scroll bar. The main window, for some reason, cannot have a scroll bar (that I can figure out, anyway), so I'm using the PaneWidget.

I tried using the pack geometry manager, however it was a MESS! I couldn't control the output. I realized, though, that the grid manager would be just what I required (to make each group of four on a separate line {or in this case, row}).

And herein lies the problem. . . (sorry for the long intro, but it kind of sets the context)

I CAN'T GET THE FRAME (the pane widget) TO OCUPY THE WHOLE WINDOW. That is, when I enlarge the window, the frame is still in a tiny portion in the middle. Using pack, I did the fill option to try to take care of it, and it worked, but I don't know what to do with grid. PLEASE HELP.

The code is here. (p.s., I tried columnspan, rowspan, but it didn't seem to have any success)

#!/usr/bin/perl use lib 'C:\MyPerlLib'; use Tk; my $i = 0; my $mw = MainWindow->new( -title => "SACL Survey" ); my $pane = $mw->Scrolled(qw/Pane -scrollbars osw/)->grid(); $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$_"}, )); } MainLoop;