Removing minimize/maximize buttons in Tkinter

In general, what decorations the WM (window manager) decides to display can not be easily dictated by a toolkit like Tkinter. So let me summarize what I know plus what I found:

import Tkinter as tk

root= tk.Tk()

root.title("wm min/max")

# this removes the maximize button
root.resizable(0,0)

# # if on MS Windows, this might do the trick,
# # but I wouldn't know:
# root.attributes(toolwindow=1)

# # for no window manager decorations at all:
# root.overrideredirect(1)
# # useful for something like a splash screen

root.mainloop()

There is also the possibility that, for a Toplevel window other than the root one, you can do:

toplevel.transient(1)

and this will remove the min/max buttons, but it also depends on the window manager. From what I read, the MS Windows WM does remove them.

Leave a Comment