Hi all,
I am new to pygtk. I create sample applet by looking at Computer temperature
applet from http://computertemp.berlios.de/. But when I try to add the
applet to panel it gave following error.

The panel encountered a problem while loading "OAFIID:GNOME_SampleApplet".

Here is my applet code.

 #!/usr/bin/env python
import pygtk
import gtk
import gobject
import gnome
import gnomeapplet


class SampleApplet(gnomeapplet.Applet):

    def __init__(self, applet, iid):
        self.__gobject_init__()
        self.applet = applet

        label = gtk.Label("Hello World")
        self.applet.add(label)

gobject.type_register(SampleApplet)

DEBUG = False

def sample_applet_factory(applet, iid):
    SampleApplet(applet, iid)
    return True

def main(debug):

    global DEBUG
    DEBUG = debug

    # Create the applet
    gnomeapplet.bonobo_factory("OAFIID:GNOME_SampleApplet_Factory",
                   SampleApplet.__gtype__,
                   "Python applet example",
                   "0.1",
                   sample_applet_factory)

and here is the server file:

<oaf_info>
        <oaf_server iid="OAFIID:GNOME_SampleApplet_Factory"
                    type="exe" location="/usr/bin/pysample.py">

                <oaf_attribute name="repo_ids" type="stringv">
                        <item value="IDL:Bonobo/GenericFactory:1.0"/>
                        <item value="IDL:Bonobo/Unknown:1.0"/>
                </oaf_attribute>
                <oaf_attribute name="name" type="string" value="Python
applet example"/>
                <oaf_attribute name="description" type="string"
value="Python applet example"/>
        </oaf_server>

        <oaf_server iid="OAFIID:GNOME_SampleApplet"
                    type="factory"
location="OAFIID:GNOME_SampleApplet_Factory">

                <oaf_attribute name="repo_ids" type="stringv">
                        <item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0
"/>
                        <item value="IDL:Bonobo/Control:1.0"/>
                        <item value="IDL:Bonobo/Unknown:1.0"/>
                </oaf_attribute>
                <oaf_attribute name="name" type="string" value="Python
applet example"/>
                <oaf_attribute name="description" type="string"
value="Python applet example"/>
                <oaf_attribute name="panel:category" type="string"
value="Utility"/>
                <oaf_attribute name="panel:icon" type="string" value="
arts.svg"/>
        </oaf_server>
        </oaf_info>
Do anyone have any idea about this problem. I am using Ubuntu 7.10 ("Gutsy
Gibbon").

Thank in advance

Milinda

-- 
http://think2ed.blogspot.com "thinksquared"
http://wsaxc.blogspot.com "Web Services With Axis2/C"
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to