in reply to Content of Perl/Tk Fixed-Width Text Label is Always Centred!?
strat had the right idea but the wrong location. -anchor isn't only a pack option, it's a standard widget option. Try:
use strict; use Tk; my $mw = MainWindow->new; my $lbl = $mw->Label( # File -text => '(start)', -width => 12, -background => 'bisque', -relief => 'groove', -anchor => 'w', )->pack; my $btn = $mw->Button( -text => "Go!", -command => \&test, )->pack; MainLoop; sub test { $lbl->configure(-text => 'A'); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Content of Perl/Tk Fixed-Width Text Label is Always Centred!?
by ozboomer (Friar) on Mar 29, 2006 at 12:45 UTC |