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:

  1. python tkinter “x” button control
  2. removing minimize/maximize buttons in tkinter

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

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -