In GTK, how do I make a window unable to be closed?
Question
For example, graying out the "X" on windows systems.
Solution
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)
OTHER TIPS
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow