开发者

Making a Python/GTK CheckMenuItem, when clicked, not close the menu

Using Python and PyGTK I've got a GtkMenu with various GtkCheckMenuItems in it. When the user clicks one of the checkboxes the menu closes. I'd like for the user to be able to check a series of checkboxes without the menu closing each ti开发者_如何转开发me.

I've looked at using the activate callback to show the menu but this doesn't seem to work. Any suggestions?


I see the problem here, the "activate" signal does not allow you to return a boolean as to whether you wish the signal to propagate onwards. It sounds like you may need to poke around the gtk.CheckMenuItem internals, fire a signal that "reopens" the menu at the current position to be processed immediately after the "activate" signal has closed down the menu, or try the mailing list.

It's probably worth noting this is more of a GTK+ question than a PyGTK, as I believe the PyGTK API reflects the GTK+ one closely on this issue.


Try digging into source and it's documentation. I have found this to be the easiest way and best shortcut.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜