in reply to What is the best way to arrange widgets using TK?
#!/usr/bin/perl -w use strict; use Tk; my %density = ( Some_Value => qw(Something), Another_Value => qw(Something_Else), Some_More => qw(Some_More), ); my $mb = MainWindow->new(); $mb->minsize(qw(200 100)); for (sort keys(%density)) { my $keytext = $mb->Frame->pack(-side => 'top', -fill => 'none', -exp +and => 1); $keytext -> Label(-text=>$_, -relief=>'ridge')->pack(-side=>'left', +-anchor=>'n'); $keytext -> Label(-text=>" ")->pack(-side=>'left', -anchor=>'n'); $keytext->Entry(-textvariable => \$density{$_},-width => 15)->pack(- +side=>'right', -anchor=>'n');; } MainLoop();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: What is the best way to arrange widgets using TK?
by ~~David~~ (Hermit) on Aug 26, 2004 at 03:05 UTC |