Creating an applet for gnome 2.0



Hi

I am a beginner at gtk/gnome programming

I have a simple gtk+ 2.0 application I have written.  I would like to
make it into a panel applet.

Following the instructions in 'Panel Applet Writer's Reference Manual' -
located in /usr/share/gtk-doc/html/panel-applet/libpanel-applet.html on
my machine, I have done the following:

I have replace my 'main' function with:
----
PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_MultiresApplet_Factory",
                             PANEL_TYPE_APPLET,
                             "Multires Applet",
                             "0",
                             multires_applet_fill,
                             NULL);
----

I have created a bonobo server file (I have manually wrapped long lines
for this email)
------------
<oaf_server iid="OAFIID:GNOME_MultiresApplet_Factory" type="exe" 
	location="/home/chrisp/Development/gnome/multires/multires">

        <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="Multires Applet Factory"/>
        <oaf_attribute name="description" type="string" 
		value="MUltires applet factory Description"/>
</oaf_server>

<oaf_server iid="OAFIID:GNOME_MultiresApplet" type="factory"
            location="OAFIID:GNOME_MultiresApplet_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="Multires
Applet"/>
        <oaf_attribute name="description" type="string" 
		value="My first applet for the GNOME2 panel"/>
        <oaf_attribute name="panel:category" type="string"
		value="Utility"/>
        <oaf_attribute name="panel:icon" type="string"
		value="gnome-applets.png"/>
</oaf_server>
</oaf_info>
------------

This file is in /usr/lib/bonobo/servers.


According to the doc, this is all I need.

However, the applet doesn't appear in my 'Panel -> Add to Panel' menu
after logging out and in again.

If I try run it manually, I get the following error:

-------------------------------------
aleph-null:~/Development/gnome/multires$ ./multires 

(multires:28542): GConf-CRITICAL **: file gconf-client.c: line 545
(gconf_client_add_dir): assertion `gconf_valid_key (dirname, NULL)'
failed
---------------------------------------




Is there any more documentation I need to read, or can somebody help me
here.

Regards
Chris
-- 
Chris Picton
Tangent Systems
chrisp tangent co za

______________________________________




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]