Portál AbcLinuxu, 12. května 2025 05:29
V panelu došlo k problému při načítání "OAFIID:GNOME_PythonAppletSample".Mohl by mi nekdo, prosim, poradit jak zjistit co je vubec spatne nebo treba i nejakou dokumentaci k vytvareni python appletu pro gnome novejsi nez z roku 2004? Mam Ubuntu 7.04, Python 2.5, Gnome 2.18.1, ale verzi to doufam neni. applet.py:
#!/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) return True print "Starting factory" gnomeapplet.bonobo_factory("OAFIID:GNOME_PythonAppletSample_Factory", gnomeapplet.Applet.__gtype__, "hello", "0", sample_factory) print "Factory ended"GNOME_PythonAppletSample.server:
<oaf_info> <oaf_server iid="OAFIID:GNOME_PythonAppletSample_Factory" type="exe" location="applet.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="PythonAppletSample"/> <oaf_attribute name="description" type="string" value="Python Applet Sample"/> </oaf_server> <oaf_server iid="OAFIID:GNOME_PythonAppletSample" type="factory" location="OAFIID:GNOME_PythonAppletSample_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="PythonAppletSample"/> <oaf_attribute name="description" type="string" value="Python Applet Sample"/> <oaf_attribute name="panel:category" type="string" value="Utility"/> <oaf_attribute name="panel:icon" type="string" value="bug-buddy.png"/> </oaf_server> </oaf_info>
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.