So I am working on a program in tkinter (Python) where I am making a calculator application similar to the one initially provided with windows for a class project. Like the windows calculator, I wish to block my calculator being able to have its dimensions changed and block the "fullscreen" button if possible. Is there any way to either lock its dimension to the one provided with the .geometry() function or at the very least block the "fullscreen" button at the top of the window?
Asked
Active
Viewed 3,674 times
1 Answers
8
Set the window to not be resizable after setting your fixed size:
window.resizable(False, False) # not resizable in both directions
If you want me to put it all together in a simple demo program:
from Tkinter import *
# make window
window = Tk()
# set size the to 640 by 480
window.geometry('640x480')
# no resize for both directions
window.resizable(False, False)
# start a program
window.mainloop()

Malik Brahimi
- 16,341
- 7
- 39
- 70
-
1Doesn't make sense to have an answer under a strictly duplicate question, in my opinion. Before answering, and instead of answering, you should check if the question with an answer already exists, and if positive, flag it as duplicate. – nbro Mar 26 '15 at 19:30