in reply to What is the best way to arrange widgets using TK?

Something like the following maybe?
#!/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();

www.perlskripts.com

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
    Thank you all for your help, I will definately use all or part of most of the responses here. I had another problem, and that is the fact that I have to display multiple columns of information. So I have a bunch of hashes that I need to display now. What I have done so far is to create frames and frames of frames, etc. Using this method, I can ->pack() everything in each frame. This is a little cumbersome, however, since I have about 12 frames now. Thanks again everyone.