how to disable maximize button?

Alex Martelli aleax at aleax.it
Fri Jul 5 16:36:36 EDT 2002


jubafre at zipmail.com.br wrote:

> how i can disable de maximise button in tkinter, i don´t want the user
> modific the size of the window, i want a real size of window, how can i do
> it???

You can remove all decorations:

import Tkinter
root = Tkinter.Tk()
root.overrideredirect(1)

Apart from this, you may choose to fix the size:

import Tkinter
root = Tkinter.Tk()
root.resizable(0,0)


I know of no way to affect the maximize button ONLY, without also
affecting other ways to resize the window, but then from your post's
text I don't see why you should ONLY want to affect said button.


Alex





More information about the Python-list mailing list