I am trying to scroll 8 text widgits. All 8 will not show up on the window at once, so I need to alow scrolling. I am trying put a Frame on a Canvas which is on the Main Window, then add scrolling to the Canvas. But when I do this, I can not scroll to the widgits that do not appear. Here is my code:
What can I do to be able to scroll to the other widgits?
Thanks,
jwperez
Code:
#!/usr/bin/perl
use Tk;
#create window, scrolled canvas and frame
my $m = MainWindow->new;
my $c = $m -> Scrolled(
"Canvas",
-scrollbars => "se" );
my $f = $c -> Frame();
#use a loop to put 8 LabEntries, Lables and Text Widgits
#in the frame
my @label_entry= (8);
my @label = (8);
my @ministry_text = (8);
for( $i = 0; $i < 8; $i++ ) {
$label_entry[$i] = $f -> LabEntry(
-label => "Ministry Name:",
-labelPack => [
-side => "left",
-anchor => "w"],
-width => 40,
-background => "white"
) -> pack( -side => "top",
-anchor => "nw" );
$label[$i] = $f -> Label(
-text => "Ministry Description:"
) -> pack(
-side => "top",
-pady => "2",
-anchor => "nw" );
$ministry_text[$i] = $f -> Text(
-width => 70,
-height => 10,
-wrap => "word"
) -> pack(
-side => "top",
-pady => "2",
-anchor => "nw" );
}
#pack and start event loop
$f -> pack();
$c -> pack();
MainLoop;
Thanks,
jwperez