views:

152

answers:

2

Example: graying out the "X" on windows systems.

+3  A: 

Just call the set_deletable with False on the window in question. It will work as long as GTK can convince the window manager to make the window unclosable.

Claudiu
Why did you answer your own question in under a minute?
Javed Ahamed
I don't know what happened here. But I like it.
Sean O'Hollaren
I had a question. then, before posting it here, I looked it up and found the answer in a few minutes. i figured i might as well add to the SO stash of questions by putting it up, along w/ an answer so as to not waste anyones time =P. vote me up!!@!# omg.
Claudiu
+4  A: 

If Gtk can't convince the window manager you can always connect the "delete-event" signal and return True from the callback. Doing this Gtk assumes that the callback handle that signal and does nothing.

import gtk

window = gtk.Window()
window.connect('delete-event',lambda widget, event: True)
markuz