I have Radiobutton
displayed in sunken button look that I would like to have:
- black text on white background when not selected,
- white text on dark gray background when selected.
Currently I only have gray background but no white text when selected, which makes for poor contrast.
for (lbl, val) in [("A", "a"), ("B", "b"))]:
rb = tk.Radiobutton(tab,
text=lbl,
variable=v,
value=val,
command=select,
selectcolor=gray,
indicatoron=0,
width=25, pady=7.5)
rb.pack(...)
tk.Radiobutton
has an option to configure selectcolor
, which is the background color when selected, but it seems to offer no such option for the foreground color when selected.
I thought that one might achieve this by specifying a command
triggered on selection that will rb.config
the foreground
on that radiobutton which is selected, but this would require accessing externally the properties of radio buttons themselves, rather than just the value of the variable they set, which I found no way to do so far.
How do I achieve an option along the lines of selectforeground
?