Problem resizing a window and button placement
MRAB
python at mrabarnett.plus.com
Fri Feb 23 21:26:43 EST 2024
On 2024-02-24 01:14, Steve GS via Python-list wrote:
> Python, Tkinter: How do I
> determine if a window has been
> resized? I want to locate
> buttons vertically along the
> right border and need to know
> the new width. The buttons are
> to move with the change of
> location of the right-side
> border.
>
Bind an event handler for '<Configure>':
----8<----
import tkinter as tk
def on_configure(*args):
print(args)
root = tk.Tk()
root.bind('<Configure>', on_configure)
root.mainloop()
----8<----
Are you placing the buttons yourself? I always use layouts and they
handle such things automatically.
More information about the Python-list
mailing list