I have problem to change indicator color for ttk radiobutton, I have followed this answer (https://stackoverflow.com/a/48497928/17286537) but nothing works for me. The indicator color stays the same, blue and when not hovered changed into black.
I have tried changing in style.configure and search another answer. But I have not found any solutions. What I expected is when the radiobutton selected, the border and indicator color change to blue, and when not hovered, the border and indicator color stays blue. Can anyone give me a solutions and explain the behavior of the tkinter framework when comes to customization? Thank you.
Here is the code that I tried so far.
from tkinter import *
import tkinter.ttk as ttk
from PIL import Image, ImageTk
root = Tk()
root.geometry('768x570')
root.title('euy')
root_frame = Frame(root)
root_frame.pack(fill=BOTH, expand=1, padx=32)
common_fg = '#FF0'
common_bg = '#0672D9'
# style_name = rb_step2.winfo_class()
style = ttk.Style()
style.configure('C.TRadiobutton', background=common_fg,
indicatorcolor=common_fg)
style.map('C.TRadiobutton',
indicatorcolor=[('selected', common_bg),
('pressed', '#FF0')]
)
rb_step2 = ttk.Radiobutton(root_frame, style='C.TRadiobutton')
rb_step2.pack()
the result