Answers for "tkinter prevent window resize"

8

tkinter how to make a root non rezizable

root.resizable(False, False)
Posted by: Guest on May-26-2020
1

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()
Posted by: Guest on May-25-2021
2

how to resize tkinter window

import tkinter

window = tkinter.Tk()       # creating the window object
window.title('my first GUI program')
window.minsize(width=600, height=500)    # makes the window 500*600

window.mainloop()           # keeping the window until we close it
Posted by: Guest on February-01-2021
1

how to make a resizable python tkinter window have a limit

win.wm_minsize(180, 120)
#Change the two numbers to the minimum window width and minimum window height.
Posted by: Guest on September-01-2020

Code answers related to "tkinter prevent window resize"

Python Answers by Framework

Browse Popular Code Answers by Language