[R-gui] ttkentry background doesnt work

jverzani jverzani at gmail.com
Tue Aug 24 16:59:50 CEST 2010


Thomas Tschager <thomastschager <at> dnet.it> writes:

> 
> Hello,
> 
> I'm trying to change the background color of a ttkentry-object. With
> tkentry-objects it works fine:
> 
>   library(tcltk)
>   tt <- tktoplevel()
>   test1 <- tkentry(tt)
>   test2 <- ttkentry(tt)
>   tkgrid(test1,test2)
>   tkconfigure(test1, background="yellow") #working
>   tkconfigure(test2, background="yellow") #not working
> 


You can use styles. Here is an example:

w <- tktoplevel()
.Tcl(paste("ttk::style layout styled.entry {",
           "  Entry.field -sticky nswe -border 0 -children {",
           "    Entry.padding -sticky nswe -children {",
           "      Entry.textarea -sticky nswe",
           "      }",
           "   }",
           "}",
           sep="\n"))
tcl("ttk::style", "configure","styled.entry", background="#b2b2b2")

e <- ttkentry(w,  style="styled.entry")

tkpack(e)




> I used different styles and tried suggestions from other mailing lists
> (http://coding.derkeiler.com/Archive/Tcl/comp.lang.tcl/2006-11/msg00528.html),
> but nothing worked for me... (I'm using WinXP)
> 
> Thanks,
> Thomas Tschager
> 
> ----------------------------------------------------
> This mail has been sent using Alpikom webmail system
> http://www.alpikom.it
>



More information about the R-SIG-GUI mailing list