Set colour in tcl variable
Immanuel -
I don't believe you can associate a color with a TclVar,
but you can use tkconfigure to change the color of a label.
Does this little program help?
library(tcltk)
base = tktoplevel()
lab = tklabel(base,text='correct',foreground='green')
tkpack(lab)
red = function(...)tkconfigure(lab,foreground='red',text='wrong')
green = function(...)tkconfigure(lab,foreground='green',text='correct')
tkpack(tkbutton(base,text='Red',command=red))
tkpack(tkbutton(base,text='Green',command=green))
- Phil Spector
Statistical Computing Facility
Department of Statistics
UC Berkeley
spector at stat.berkeley.edu
On Fri, 19 Nov 2010, Immanuel Seeger wrote:
Hello all,
using package tcltk this is my problem:
I want to set a colour of a tclVar().
I have a tklabel (fixed in position) which should display two variables
occasionally.
If a constraint is fulfilled, the tklabel should display
correct<-tclVar('correct') in green, otherwise it should display
wrong<-tclVar('wrong') in red!
To display the variables is no problem, but getting colour into them.
Up to now for me it was only possible to set the colour of the whole label.
Any advice?
Thanks!
Immanuel Seeger
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.