Re: Writing Gnome2 applets



James Kahn wrote:

I hope I've got the right list for some help here - please refer me to
the correct one if I'm wrong.

I'm mostly pretty new to this gtk and gnome thing, but I learn things
pretty quickly.  I'm trying to write a Gnome2 applet but it all seems
completely different from the way that I read about for Gnome 1 here -
http://developer.gnome.org/doc/tutorials/applet/index.html.

I've downloaded the source for gnome-applets, but I'm confused as to how
they are loaded.
They are loaded by calling a macro which acts as main(argc,argv) and also calls gnome-init.
You can see an example of this here:
http://cvs.gnome.org/lxr/source/gnome-applets/panel-menu/panel-menu.c


The macro called is:

PANEL_APPLET_BONOBO_FACTORY (/"OAFIID:GNOME_PanelMenuApplet_Factory"/,
                        PANEL_TYPE_APPLET,/
                        "PanelMenu-Applet-Factory"/,/
                        ""/,
                       applet_factory,
                       NULL)

or

PANEL_APPLET_BONOBO_SHLIB_FACTORY.

To see how this works, it is defined in /usr/include/panel-2.0/panel-applet.h

If I type /usr/lib/gnome-applets/geyes_applet2 in a
terminal, it fails to load, but it works fine by right clicking on the
panel so obviously it's not loaded in a "conventional" sense.

Are there any documents available that teach you what you need to know
to build a gnome2 applet?  Or can someone write one if not? ;)  Any help
appreciated here.
The documentation is INCREDIBLY poor. As far as I know the only documentation is the code itself for the new gnome2 applets. The only other documentation is for gnome1 which is completely useless and unrelated.

Thanks,
James.

I tried to get applets to work from my application WITHOUT using the macro which acts as a main(argc,argv) entry point for you application so that I could simply add an icon into the panel. I was unsuccessfull and because the documentation is poor I didnt continue it. If anyone manages to do this, post it here and/or let me know.

Regards,

Martyn




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