开发者

How to connect the "show" and "hide" signals with PyGTK?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜