My weekly QuickQuestion(tm)... I'm going gaga on a simple Perl/Tk
operation ( see my scratchpad ) When -width is
specified, why is the text label contents always centred? -
justify is documented to only work with multi-line contents. How
can the contents of a fixed-width text label be left-justified?
use strict;
use Tk;
my $mw = MainWindow->new;
my $lbl = $mw->Label( # File
-text => '(start)',
# -width => 12,
-background => 'bisque',
# -justify => 'left',
-relief => 'groove',
)->pack;
my $btn = $mw->Button(
-text => "Go!",
-command => \&test,
)->pack;
MainLoop;
sub test {
$lbl->configure(-text => 'A');
}
this node xml
test
Aug 19, 2009 at 01:35 UTC
|