hi everyone.....
Can someone tell me 'how can we disable the close icon' which is found on upper left corner of a tkinter menu which is encircled in the picture below:
Thanks in advance

Recommended Answers

All 3 Replies

Here is an example how to do this with the Windows OS ...

# disable window title bar corner x click
# you need to supply your own exit button

from Tkinter import *

def exit():
    "dummy function"
    pass

root = Tk()
root.protocol("WM_DELETE_WINDOW", exit)

btn_quit = Button( text="Quit", command=root.destroy )
btn_quit.pack()

root.mainloop()

thanks you vegaseat. you are the best......

and for Linux user

replace

root.protocol("WM_DELETE_WINDOW", exit)

with this

root.overrideredirect(1)
commented: Usefull info but to old thread. +3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.