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

2010-01-28 Thread David Salisbury
Hi

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 I can't
figure a way to make this work. I've tried various things including having
the following in the activate event callback function:

menu.show_all()
menu.popup(None, None, None, 1, gtk.get_current_event_time())

This is the code I use to show the menu when the trayicon is clicked but
in this instance it doesn't show.  In addition I've tried passing in my
own function to set the menu position to, for example, (100,100) but this
has not been successful.

Any suggestions?

Many thanks,
David Salisbury

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


safely emit signal to main loop (main thread) from worker thread

2010-01-28 Thread ferar achkar
greetings,
How can I safely emit a custom signal from a working thread to gtk main
loop (main thread) to execute a custom call back function connected to
that custom signal. A short working example or a link to that is
appreciated.
regards,
ferar

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: safely emit signal to main loop (main thread) from worker thread

2010-01-28 Thread Florian Müllner
El jue, 28-01-2010 a las 17:09 -0500, ferar achkar escribió:
 How can I safely emit a custom signal from a working thread to gtk main
 loop (main thread) to execute a custom call back function connected to
 that custom signal.

Not sure if I understand your intention here. In GObject/GTK+, signals
are tied to objects and are emitted, not sent - meaning that the
object does not have any knowledge where (or if) and by whom the signal
is handled. Really, it's pretty much like radio which is broadcasted so
you may tune in (or not), not sent specifically to your receiver.

If all you want is executing some function in the main thread, you maybe
the g_timeout/g_idle functions provide what you're looking for.

With that having said, it is always a good idea to provide some stripped
down source code.

Happy hacking!
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

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

2010-01-28 Thread Freddie Unpenstein
 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 looked into this myself a while back, and gave up.  More important things to 
do, and so forth.

One thing did occur to me, though.  It's kind of annoying when you click a 
check menu item, and the menu doesn't go away. And having some that do, and 
some that don't, would probably drive my balmy.

I wonder, if it would be sane for menus to not close, say, if the shift or ctrl 
key is being held down.  In some rare occasions it's even useful for 
non-togglable menu items.  For example, recently used documents perhaps; you 
could open the last three documents by holding down the shift key while you 
clicked on them.  (Some thought would have to go into subsequent selections 
opening new tabs/windows, but that's a separate issue.)


Back to the original question; the better way, would probably be to use a 
dialog box in this instance, to allow these options to be changed without 
having to go back to the menu all the time.  Perhaps depending on usage, an 
Options menu item as well as the individual options, which brings them up in a 
dialog for when you need to change multiple options.


Fredderic


Put your loved ones in good hands with quality senior assisted living. Click 
now!
Senior Assisted Living
http://tagline.excite.com/c?cp=KygC6Sa4isQW3maEJScgqAAAKZSlMmZOmLoSxr7IH9qxTEOrAAYAAADNAAASUQA=
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list