I have a custom GTK widget (basically an overlay of HBox over a Cairo surface). I wish to hide it when I click outside the widget in the window. Similar to how menus behave.
I tried using grab_focus and wait for the focus-out-event but the widget doesn't grab focus, I think it's not a focusable widget.[1]
[1] https://developer.gnome.org/pygtk/2.24/class-gtkwidget.html#method-gtkwidget--grab-focus