packetstormer has asked for the wisdom of the Perl Monks concerning the following question:
Hello
I am using Tk for the first time and I can't seem to align the label/entry correctly vertically. Has anyone done this beofore? I did try padding out the text but it looks terrible
#!/usr/bin/perl use strict; use Tk; my $btypes; my $locations; my $bstats; my $mw; $mw = MainWindow->new; $mw->geometry("400x300"); $mw->title("First App"); my $frmTop = $mw->Frame(-bd => 2,-relief => 'ridge')->pack(-side => 't +op', -fill => 'x', -pady => 3); # Location label/entry my $frmLocations = $frmTop->Frame(-bd => 2)->pack(-side => 'top', -fil +l => 'y'); my $lblLocationsID = $frmLocations->Label(-text => "Locations")->pack( +-side => 'left'); my $edtLocationsID = $frmLocations->Entry(-textvariable => \$locations +,-background => 'white')->pack(-side => 'left'); # type label/entry my $frmLocations = $frmTop->Frame(-bd => 2)->pack(-side => 'top', -fil +l => 'y'); my $lblBtypeID = $frmLocations->Label(-text => "Types" )->pack(-sid +e => 'left'); my $edtBtypeID = $frmLocations->Entry(-textvariable => \$btypes,-backg +round => 'white')->pack(-side => 'left'); MainLoop;
Thanks!
EDIT: Not sure about the $frmLocations being overwritten in the "type lable/entry" !
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Tk - aligning Labels
by thundergnat (Deacon) on Sep 13, 2012 at 16:05 UTC | |
Re: Tk - aligning Labels
by stefbv (Curate) on Sep 13, 2012 at 16:46 UTC | |
Re: Tk - aligning Labels
by Khen1950fx (Canon) on Sep 13, 2012 at 17:45 UTC | |
Re: Tk - aligning Labels
by Sandy (Curate) on Sep 14, 2012 at 12:05 UTC | |
Re: Tk - aligning Labels
by sundialsvc4 (Abbot) on Sep 13, 2012 at 15:33 UTC |
Back to
Seekers of Perl Wisdom