Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2018-03-23 22:50 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (297 votes). Check out past polls.