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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -