RE: text in a widget, text-widget

"Van Nieuwenhuize, Mike" <[email protected]> Tue, 25 Apr 2006 11:31:33 -0700
Newsgroups gmane.comp.lang.perl.tk
Message-ID <[email protected]>
You can use tags with in the text widget. See the documentation in
Tk::Text for more explanation on how they work.

How to configure:

    $scrolled->tagConfigure('BLUE',-background => 'blue');
    $scrolled->tagConfigure('RED',-foreground => 'red'); 
    $scrolled->tagConfigure('GREEN',-foreground => 'green');

Here is how I use them:

    $scrolled->insert('end',$job_header,'RED') if ($job_header);
    $scrolled->insert('end',$running_proc,'BLUE') if ($running_proc);
    $scrolled->insert('end',$pend_proc,'RED') if ($pend_proc);
    $scrolled->insert('end',$stop_proc,'RED') if ($stop_proc);
    $scrolled->insert('end',$errors,'RED');

Haven't tried the link think myself but if I remember correctly you can
assign callbacks to tags. Check the docs....

HTH.....

Regards,

Mike
-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Johan Meskens CS3 jmcs3
Sent: Tuesday, April 25, 2006 11:12 AM
To: [email protected]
Subject: text in a widget, text-widget


hello


i have an application with a couple of text widgets but i would like to
add some functionalities that at first and second sight are not directly
supported by the plain text widget itself
 - ?

for example i would like certain lines of text within the textwidget to
take  different background colors according to certain parameters

also i would like to be able to detect certain sentences or words that
would become 'links' and by clicking them i would open up different
windows

any suggestions to solutions and widgets for the above problems ?

 - i probably could use the canvas for the color-thing .. as i write
this ..

kind regards
jmcs3








--------the following could be unreadable @ 1145988711   ::: 
--a-=-t-g-i-
 , Bottom:
 , particular
 , ||
 , |2
 , },
 , oo,loent,uaha
 , ::::::opthe
 , lead
 , |
 , |---|
 , _________________
 , 




-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list server.
If you wish to unsubscribe from this mailing list, send the message body
of "unsubscribe ptk" to [email protected]

-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to [email protected]