python - Disable, hide or remove close "X" button in Tkinter -
i want show gui client, don't want give possibility client close window through [x]
button.
how disable, hide or remove close [x]
button of tkinter window?
i found following answers:
however, these posts not answering question. want disable, hide or remove [x]
button.
when use protocol
:
def __init__(self): frame.__init__(self, bg = "black") self.protocol('wm_delete_window', self.dosomething) self.pack(expand = 1, fill = both) def dosomething(self): if showinfo.askokcancel("quit?", "are sure want quit?"): self.quit()
i receive following error:
self.protocol('wm_delete_window', self.dosomething)
attributeerror: 'gui' object has no attribute 'protocol'
the problem calling protocol
method it's method on root window gui object not root window. code work if call protocol method on root window.
as how remove button -- there's no method remove 1 button. can remove of window manager buttons , frame setting overrideredirect
flag.
Comments
Post a Comment