consider the following python code:
import gtk
class MainWindow():
def __init__(self):
self.window = gtk.Window()
self.window.show()
if __name__ == "__main__":
main = MainWindow()
gtk.main()
I’d need to catch clicks anywhere inside this gtk.Window().
I haven’t found any suitable event (I also tried button-press-event, but it doesn’t work), what am I missing?
Thank you!
You can pack a
gtk.EventBoxinto the window. In general, whenever you have troubles catching events, check ifgtk.EventBoxsolves them.Note, however, that event propagation upwards the widget hierarchy will stop if a widget handles event itself. For instance, a parent of
gtk.Buttonwon’t receive click events from it.