Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 time.

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

like image 598
davedavedave Avatar asked Jan 27 '10 22:01

davedavedave


1 Answers

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.

like image 148
Matt Joiner Avatar answered Oct 18 '22 23:10

Matt Joiner