Re: 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

Re: radiobutton / checkbutton text in multiple colors

From: Donald Arseneau <asnd@triumf.ca>
Date: Sun Jul 31 2005 - 21:05:53 CEST

"Peter Schellenberg" <schelli@imb-jena.de> writes:

> thanks for the answer. However I wonder if it is the answer to my
> question, especially since I wanted to have different colors within one
> text for the same button like:

set w .tb
text $w -relief raised -bd 2 \
    -width 25 -height 1 \
    -cursor {}

$w tag configure color2 -foreground red
$w insert end " Fake Button with "
$w insert end "text in color " color2

$w configure -state disabled

bind $w <1> { $w configure -relief sunken
    set press_mess "Button pressed [incr press_count] times"
}
bind $w <ButtonRelease-1> {
    after 30 $w configure -relief raised
}

label .mess -textvar press_mess
set press_count 0
set press_mess "Button pressed 0 times"

pack .tb .mess

It is even easier for radio buttons and check buttons beca
    

> radiobutton $w.left.b$i -text "Text in 1st color, 2nd color, 3rd color"
> -variable i1 -relief flat -value $i
>
> I am sorry that I am not more familiar with TCL/Tk but I only need it
> in connection with a program that uses it as an embedded scripting
> language
>
> Kind regards Peter
>

-- 
Donald Arseneau                          asnd@triumf.ca
Received on Thu Sep 29 14:28:10 2005