Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re^2: Perl tk [ Tk::Text -justify option is not working

by ungalnanban (Pilgrim)
on Mar 01, 2010 at 07:22 UTC ( #825839=note: print w/replies, xml ) Need Help??

in reply to Re: Perl tk [ Tk::Text -justify option is not working
in thread Perl tk [ Tk::Text -justify option is not working

Hi.. I used Text widget so I wrote my code like.
$align -> command(-label =>"Left",-command=>sub { #$txt->configure( -justify =>'left'); $txt->tagConfigure('left', -justify => 'left'); } ); $align -> command(-label =>"Right",-command=>sub { #$txt->configure(-justify=>'right'); $txt->tagConfigure('right', -justify => 'right'); } ); $align -> command(-label =>"Center",-command=>sub { #$txt->configure(-justify=>'center'); $txt->tagConfigure('center', -justify => 'center'); } );

but the text in the Text widget are not aligned to left,right or center.
How can I achieve the text alignment option in Text widget?

Replies are listed 'Best First'.
Re^3: Perl tk [ Tk::Text -justify option is not working
by zentara (Archbishop) on Aug 02, 2010 at 17:48 UTC
    I don't see a running code example, but the Tk demo "widget" has a text example which shows centered tag usage.
    $t->tag(qw/configure center -justify center/);

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2016-10-22 09:16 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (294 votes). Check out past polls.