Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by ungalnanban (Pilgrim)
on Mar 01, 2010 at 07:22 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-20 00:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found