Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Tk - aligning Labels

by stefbv (Curate)
on Sep 13, 2012 at 16:46 UTC ( [id://993534]=note: print w/replies, xml ) Need Help??


in reply to Tk - aligning Labels

Another option is to use the 'form' geometry manager:

#!/usr/bin/perl use strict; use warnings; use Tk; use Tk::widgets qw(LabFrame); my $mw = MainWindow->new; $mw->title('First App'); #--- Locations my $locations_f = $mw->LabFrame( -label => 'Locations', -labelside => 'acrosstop', -foreground => 'blue', ); $locations_f->pack( -side => 'top', -expand => 1, -fill => 'x', ); #-- locations my $llocations = $locations_f->Label( -text => 'Locations' ); $llocations->form( -top => [ %0, 0 ], -left => [ %0, 5 ], ); my $elocations = $locations_f->Entry( -width => 20, ); $elocations->form( -top => [ %0, 0 ], -left => [ %0, 80 ], -padright => 5, ); #-- types my $ltypes = $locations_f->Label( -text => 'Types' ); $ltypes->form( -top => [ $llocations, 8 ], -left => [ %0, 5 ], ); my $etypes = $locations_f->Entry( -width => 15, ); $etypes->form( -top => [ '&', $ltypes, 0 ], -left => [ %0, 80 ], -padbottom => 5, ); MainLoop;

Regards, Ştefan

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://993534]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2024-04-18 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found