tkinter make window not resizable
root.resizable(False, False)
tkinter make window not resizable
root.resizable(False, False)
python tkinter resize window on button click
from tkinter import *
root = Tk()
root.title("Title")
root.geometry("800x800")
# Resize on button click
def resize():
root.geometry("500x500")
button_1 = Button(root, text="Resize", command=resize)
button_1.pack(pady=20)
# Resize by parameters
def resize2():
w = 650
h = 650
root.geometry(f"{w}x{h}")
button_2 = Button(root, text="Resize", command=resize2)
button_2.pack(pady=20)
# Resize by user entered parameters
def resize3():
w = width_entry.get()
h = height_entry.get()
root.geometry(f"{w}x{h}")
width_label = Label(root, text="Width:")
width_label.pack(pady=20)
width_entry = Entry(root)
width_entry.pack()
height_label = Label(root, text="Height:")
height_label.pack(pady=20)
height_entry = Entry(root)
height_entry.pack()
button_3 = Button(root, text="Resize", command=resize3)
button_3.pack(pady=20)
root.mainloop()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us