Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

probably a stupid question about checkbutton but...

Status
Not open for further replies.

irenicus

Technical User
Jul 15, 2004
11
FR
i'm trying to make a button where font color and background color exchage whether it is selected or not. I'm trying whith a checkbutton but there is no simple way to change the foreground


checkbutton .chkbutton -bg $color1 -foreground $color2 -font {Courier 12} -text T -selectcolor $color2 -indicatoron 0 -command { .chkbutton configure -foreground $color1 }

(of course once the button have been selected one time the font color stay color1.
 
what about ...

-command {
if {[.chkbutton configure -foreground] == $color1} {
.chkbutton configure -foreground $color2
} else {
.chkbutton configure -foreground $color1
}
 
thx
but i've hoped that another solution exist (another widget for example)...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top