Greetings,

Thanks to dispatcher.py and your example, I was able to get my applet
working almost as intended!

However, I still have a couple of questions...

I've attached the entire text my my applet launching script below. As
you can see, when I run it from the command line as 'gnoptray.py
run-in-window' it runs in a Gnome window. And it runs perfectly,
threading and all... I am very, very happy.

However, if I run it as a panel applet, the program still loads... But
the threads do not run. I have not got any sort of logging code, but I
can see by watching my network monitor that it never even attempts to
check for e-mail.

My suspicion is this is because I cannot call threads_enter() and
threads_leave() when launching the applet. When I try anyway... the
entire gnome panel locks up! Any clues on how to handle this?

Regards,

----
# Import standard modules
import gtk, gnomeapplet, sys, os, cPickle

# Import my modules
import cApplet, guiAccount, cAccounts

def gnoptray_applet_factory(applet, iid):
    gnoptray_applet = cApplet.Gnop_App(applet, iid)
    return gtk.TRUE 
    
gtk.threads_init()
    
if len(sys.argv) == 2 and sys.argv[1] == "run-in-window":   
    main_window = gtk.Window(gtk.WINDOW_TOPLEVEL)
    main_window.set_title("Python Applet")
    main_window.connect("destroy", gtk.main_quit) 
    app = gnomeapplet.Applet()
    gnoptray_applet_factory(app, None)
    app.reparent(main_window)
    main_window.show_all()
    gtk.gdk.threads_enter()
    gtk.main()
    gtk.gdk.threads_leave()
    sys.exit()

else:
    gnomeapplet.bonobo_factory("OAFIID:GNOME_Gnoptray_Factory",
                                gnomeapplet.Applet.__gtype__,
                                "hello", "0", gnoptray_applet_factory)
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to