Removing minimize/maximize buttons in Tkinter

Posted on

Question :

Removing minimize/maximize buttons in Tkinter

I have a python program which opens a new windows to display some ‘about’ information. This window has its own close button, and I have made it non-resizeable. However, the buttons to maximize and minimize it are still there, and I want them gone.

I am using Tkinter, wrapping all the info to display in the Tk class.

The code so far is given below. I know its not pretty, and I plan on expanding the info making it into a class, but I want to get this problem sorted before moving along.

Anyone know how I can govern which of the default buttons are shown by the windows manager?

def showAbout(self):

    if self.aboutOpen==0:
        self.about.title("About "+ self.programName)

        Label(self.about,text="%s: Version 1.0" % self.programName ,foreground='blue').pack()
        Label(self.about,text="By Vidar").pack(),text="Contact:",font=("Helvetica", 10))
        self.closeButton=Button(self.about, text="Close", command = lambda: self.showAbout())
        self.about.geometry("%dx%d+%d+%d" % (175,

        self.about.protocol("WM_DELETE_WINDOW", lambda: self.showAbout())
'<Leave>', self.contactMouseOver)'<Enter>', self.contactMouseOver)'<Button-1>', self.mailAuthor)

def contactMouseOver(self,event):

    if event.type==str(7):"Helvetica", 10, 'underline'))
    elif event.type==str(8):"Helvetica", 10))

def mailAuthor(self,event):
    import webbrowser'',new=1)
Asked By: Vidar


Answer #1:

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

# # 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


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


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.

Answered By: tzot

Answer #2:

from tkinter import  *

qw.resizable(0,0)      #will disable max/min tab of window

enter image description here

from tkinter import  *

qw.overrideredirect(1) # will remove the top badge of window

enter image description here

here are the two ways to disable maximize and minimize option in tkinter

remember the code for button shown in image is not in example as this is solution regarding how to make max/min tab nonfunctional or how to remove

Answered By: Er M S Dandyan

Answer #3:


For windows, you can use -toolwindow attribute like that:

root.attributes('-toolwindow', True)

So if you want complete code, it’s that

from tkinter import *

from tkinter import ttk

root = Tk()

root.attributes('-toolwindow', True)


Other window.attributes attributes:


Important note this is only working with Windows. Not MacOS


With mac you can use overredirect attribute and a “x” button to close the window and this will do the job. 😀 like that:

from tkinter import *

from tkinter import ttk

window = Tk()


Button(window, text="x", command=window.destroy).pack()


Inspired by

For me, it’s working, i have a windows 7.

Comment me if i have a error.

Answered By: Ellicode

Leave a Reply

Your email address will not be published. Required fields are marked *