I have the following code to create a button in Tkinter:
button = Button(self.parent_frame, width=100, height=100)
frame = Frame(button)
label = Label(frame, text="This is a button")
frame.pack(fill=BOTH, expand=1)
label.pack(fill=BOTH, expand=1)
When I hover over parts of the button, the button quickly resizes to the width of the window, and then returns to its original size. Why is this happening? Is it allowed to have a Tkinter button for children?
Note. I do not plan to use the frame inside the button, I just ask about it for hypothetical purposes. So instead of answers suggesting workarounds, I would rather explain why this is happening.
source
share