I've found some unexpected (to me) behaviour in tkinter I'd like to understand a little better.
This is Tcl/Tk 8.6 and Python 3.9.2 on macOS, and the code below creates a very simple window where the Label c is updated by the Radiobuttons a and b.
The unexpected behaviour is this if the 'blueberry' radio button is selected (and so the Label is displaying 'blueberry'), and I then click on the 'apple' radio button but do not move the mouse the text 'apple' appears, but with the 'bl' and 'y' of 'blueberry' still visible behind it, and they (and presumably the rest of 'blueberry') only disappear when I move the mouse.
I can easily resolve this aesthetically by simply adding 'sticky=EW' to the c.grid() statement, I assume the text 'blueberry' is actually still there (but now hidden by the label that fills the whole cell) and only disappears again when I move the mouse.
I thought it would be good to understand what is happening here in case I run into situations without such a straightforward solution, and for the general benefit of my programming quality. The closest question I could find on SO is Tkinter GUI only updates when mouse is moved, but I don't think I understand it well enough to know if it's the same behaviour that I'm describing.
from tkinter import *
from tkinter import ttk
root = Tk()
frame = ttk.Frame(root)
frame.grid()
fruit = StringVar()
a = ttk.Radiobutton(frame, text='apple', variable=fruit, value='apple')
b = ttk.Radiobutton(frame, text='blueberry', variable=fruit, value='blueberry')
c = ttk.Label(frame, textvariable=fruit)
a.grid(sticky=W)
b.grid(sticky=W)
c.grid()
root.mainloop()