Dave wrote:
> "MoshiachNow" <> wrote in message
> news: oups.com...
>
>>HI,
>>
>>Using a function on Windows,I define a $test variable as following:
>>
>>$text=sprintf("%-35s %-13s",$_,'(directory)');
>>
>>Then define the checkbutton:
>>The text in $text DOES NOT get lined up !
>
>
> By default the text is 'center' anchored; you probably don't want this so
> try setting the -anchor option, e.g. anchor => 'w', as appropriate.
>
>
>
In addition you might consider using a fixed-width font to have the second part
of your label aligned vertically as well:
use strict;
use warnings;
use Tk;
my $mw = tkinit();
my @text =
map {sprintf("%-35s %-13s",$_,'(directory)')
} qw(test something_else);
my @buttons =
map {$mw->Checkbutton(-text => $text[$_],
-font=>[courier => 9]
)->pack(-anchor=>'w')
} (0,1);
MainLoop();
Christoph
--
perl -e "print scalar reverse q//"
|