0

i have been trying to change the colour of my check buttons for days now, tried Style() and that didn't work, and now i have tried .configure but it doesn't do anything at all...this is my code please help me out if possible, i've gone over the DOCS many times and tried what they said, i'm so lost...this is my code:

#define check buttons
check1 = ttk.Checkbutton(window, text="Meat Lovers", variable=cvar, onvalue=1, offvalue=0).configure(foreground="white", background="black")
check1.grid(column=0, row=1, padx=(5, 95))
check2 = ttk.Checkbutton(window, text="Supreme", variable=cvar2, onvalue=1, offvalue=0).configure(foreground="white", background="black")
check2.grid(column=0, row=3, padx=(10, 120))
check3 = ttk.Checkbutton(window, text="Vegetarian", variable=cvar3, onvalue=1, offvalue=0).configure(foreground="white", background="black")
check3.grid(column=0, row=5, padx=(10, 120))
simmo
  • 123
  • 1
  • 2
  • 11
  • i looked and tried that, hence the Style() that i mentioned, but it didn't change anything which is why i tried this, same result which is why i'm asking for assistance...maybe i wrote it wrongly with style, i'm still very new – simmo Apr 19 '17 at 13:11
  • 1
    You only mentioned that, but doesn't showed anything with it. Your current code is unworkable because `configure` returns `dict` object, so you can't `grid` a `dict`. After all I thinked that your done something wrong with style and since your question is total duplicate of existed question - I done what I've done. No offence, but ttk styles really depends on system platform! – CommonSense Apr 19 '17 at 13:32
  • none taken, i learned something new from what you said about grid a dict so thanks for that, i don't believe in bad replies...everything is a lesson, i will give style a try again :) – simmo Apr 19 '17 at 13:41

1 Answers1

0

I believe this depends on the particular platform. Some platforms won't allow certain elements to change from the system default styling no matter how you configure them.

holdenweb
  • 33,305
  • 7
  • 57
  • 77
  • i use python 3.6, write my code on sublime and run my code via gitbash if that helps at all? – simmo Apr 19 '17 at 13:12