I would like to have a callback called when some widget (a Menu
) is shown or hidden. Doing this way :
menu = gtk.Menu()
menu.connect("show", self.menu_show, menu)
menu.connect("hide", self.menu_hide, menu)
Callback functions are never called. Are show
and hide
signals the ones I am lo开发者_StackOverflowoking for ? Are they special ? Is there something I am missing to have this working ?
I think those signals are emitted only when the respective methods on an object are called. If you want to connect to when a widget is (re-) drawn, take the expose-event signal. But why do you want to anyway? A menu is there to provide to the user choices for actions, not to run some setup/teardown code when it is shown/hidden.
精彩评论