0

I have crated a button box in tkinter using this:

v = StringVar()
v.set("L")

b1 = tk.Radiobutton(root, text="1", variable=v, value=1, indicatoron=0, bg="red")

The button is red BUT as I click on it it turns white. How can I fix is? I want it to be red all the time. Thank You :)

1
  • 2
    Set the activebackground option to the same value as bg. Commented Jul 24, 2020 at 16:57

2 Answers 2

1

simple solution: selectcolor='red'

Sign up to request clarification or add additional context in comments.

Comments

1

You can simply add a attribute activebackground

v = StringVar()
v.set("L")

b1 = tk.Radiobutton(root, text="1", variable=v, value=1, indicatoron=0, bg="red",activebackground="red")

I think this will work

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.