radiobutton / checkbutton text in multiple colors
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

radiobutton / checkbutton text in multiple colors

From: <schelli@imb-jena.de>
Date: Sun Jul 31 2005 - 10:55:04 CEST

Hi ,

I would like to create text in different colors within the text field
of a radiobutton (or analogously a button, checkbutton or hypertext) :

radiobutton $w.left.b$i -text "Text in 1st color, 2nd color, 3rd color"
-variable i1 -relief flat -value $i

It would be convenient to first define the text as a variable:

set mytext "Text in 1st color, 2nd color, 3rd color"
radiobutton $w.left.b$i -text "$mytext" -variable i1 -relief flat
-value $i

How can I do this in TCL/Tk ? I am aware of the tag syntax:
$w.text tag configure color2 -foreground red
...
$w.text insert end "Text in color 2" color2

however, I am not able to apply this in a text field of a button or to
the definition of a variable.

Thanks for help in advance Peter
Received on Thu Sep 29 14:28:05 2005