All pastes #209598 Raw Edit

Untitled

public text v1 · immutable
#209598 ·published 2006-10-19 07:41 UTC
rendered paste body
#!/usr/bin/env python

import pygtk
pygtk.require('2.0')

import gtk
import gnomeapplet
import gobject

def background_show(applet):
    print "background: ", applet.get_background()

def sample_factory(applet, iid):
    print "Creating new applet instance"
    label = gtk.Label("Success!")
    applet.add(label)
    applet.show_all()
    #gobject.timeout_add(1000, background_show, applet)
    #print dir(applet)
    return True

print "Starting factory"
gnomeapplet.bonobo_factory("OAFIID:GNOME_PythonAppletSample_Factory", 
                           gnomeapplet.Applet.__gtype__, 
                           "hello", "0", sample_factory)
print "Factory ended"


"""ghia=gtk.Window()
sample_factory(ghia,3)
ghia.show_all()
gtk.main()"""