[R-gui] ttkentry background doesnt work

Gabor Grothendieck ggrothendieck at gmail.com
Wed Aug 25 02:31:34 CEST 2010


On Tue, Aug 24, 2010 at 1:30 PM, Peter Dalgaard <pdalgd at gmail.com> wrote:
> On 08/24/2010 04:59 PM, jverzani wrote:
>
> 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)
>
> The whole thing indicates some rather glaring gaps in the interface.
> Pasting large stretches of Tcl code together like that _should_ be
> unnecessary, but for now, that's probably what you have to do.

You can do this which does not use paste:

w <- tktoplevel()
.Tcl("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)



More information about the R-SIG-GUI mailing list