Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Tk - aligning Labels

by stefbv (Chaplain)
on Sep 13, 2012 at 16:46 UTC ( #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


Comment on Re: Tk - aligning Labels
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2014-08-31 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls