in reply to Tk List of Checkboxes?
Warning: I, too, am new to the Tk parts of Perl. I have Mastering Perl/Tk at the office, but have not yet read it.
jlongino, I think that there are two problems in your code:
The code below "works"; it scrolls, it looks like what Flame asked for, and each button tracks its input separately. There may be a simpler way, though.
#!/usr/bin/perl -W use warnings 'all'; use strict; use Tk::Pane; my $mw = Tk::MainWindow->new(); my $pane = $mw->Scrolled( 'Pane', -scrollbars => 'oe' )->pack( -expand => 'yes', -fill => 'both', # "-fill => 'y'" works, too ); my @list; for my $text ('A' .. 'Z') { my $value; $pane->Checkbutton( -anchor => 'w', -text => $text, -variable => \$value, )->pack( -side => 'top', -fill => 'x', ); push @list, \$value; } Tk::MainLoop(); printf "%s\n", $$_||0 foreach @list;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Tk List of Checkboxes?
by Flame (Deacon) on Jun 09, 2002 at 23:02 UTC |