0

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

Attachments pass.JPG 45.44 KB
3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by gleam.uahmed
0

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()
1

and for Linux user

replace

root.protocol("WM_DELETE_WINDOW", exit)

with this

root.overrideredirect(1)
Votes + Comments
Usefull info but to old thread.
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.