Re: Problem developing panel applet

In <1032279369 2982 960 camel michael home>, you wrote:

> On Mon, 2002-09-16 at 23:23, Tony Houghton wrote:
> > Now I'm stuck with the Gnome2 version of my applet.
> 	What happens if you run the applet by itself ? does the
> bonobo_activation_register thing succeed ? if not you should exit. If
> that's the case - you didn't install the .server file in the right place
> and/or b-a-s didn't notice it there. Try killall -9
> bonobo-activation-server [ this will have somewhat wierd effects until
> you re-start the desktop incidentally ].

Er, what bonobo_activation_register thing? I don't really know anything
about Bonobo, I just copied the applet examples, and I didn't see any
bonobo_activation_register anywhere :-/.

If I run it manually, the same thing seems to happen.

I don't really know what else I can do now except show the relevant bits
of code etc in the hope that someone can spot my mistake.

This is the main bit of code I'm using, which I've hacked with macros a
bit to try to debug it:

#undef panel_applet_factory_main

static int my_factory_main(const gchar *iid, GType applet_type,
	PanelAppletFactoryCallback callback, gpointer data)
    int result;

    g_log(0, G_LOG_LEVEL_DEBUG, "About to call panel_applet_factory_main:\n"
	    "  iid: %s\n  applet_type: 0x%lx\n  callback: %p\n  data: %p",
	    iid, applet_type, callback, data);
    result = panel_applet_factory_main(iid, applet_type, callback, data);
    g_log(0, G_LOG_LEVEL_DEBUG, "Result of panel_applet_factory_main = %d",
    return result;

#undef gnome_program_init

static GnomeProgram *
my_program_init(const char *app_id, const char *app_version,
		    const GnomeModuleInfo *module_info,
		    int argc, char **argv,
		    const char *first_property_name, ...)
    GnomeProgram *result;
    va_list ap;

    g_log(0, G_LOG_LEVEL_DEBUG, "About to call gnome_program_init:\n"
	    "  app_id: %s\n  app_version: %s\n  first_property_name: %s",
	    app_id, app_version, first_property_name);
    va_start(ap, first_property_name);
    result = gnome_program_init(app_id, app_version, module_info, argc, argv,
	    first_property_name, ap);
    return result;

#define panel_applet_factory_main my_factory_main
#define gnome_program_init my_program_init

	"Tgauge", "0", panapp2_fill, NULL)

/* End */

The "About to call" messages both get printed, but I've also got a
message at the start of my panapp2_fill function, and that never gets

I've installed the binary as /usr/lib/gome-applets/tgauge_applet2
because that's where the other applets are installed, and similarly, my
.server file is /usr/lib/bonobo/servers/GNOME_TgaugeApplet.server. Am I
supposed to do anything besides copy it there? The's for the
existing applets didn't seem to do anything special, and an entry does
appear in the panel menu.

Here are the contents of GNOME_TgaugeApplet.server:


<oaf_server iid="OAFIID:GNOME_TgaugeApplet_Factory"

	<oaf_attribute name="repo_ids" type="stringv">
		<item value="IDL:Bonobo/GenericFactory:1.0"/>
		<item value="IDL:Bonobo/Unknown:1.0"/>
	<oaf_attribute name="name" type="string" value="Tgauge Applet Factory"/>
	<oaf_attribute name="description" type="string" value="Tgauge Applet Factory"/>


<oaf_server iid="OAFIID:GNOME_TgaugeApplet"

	<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 name="name" type="string" value="Temperature gauge"/>
	<oaf_attribute name="description" type="string" value="Gauges for monitoring CPU temperature etc"/>
	<oaf_attribute name="panel:category" type="string" value="Utility"/>
	<oaf_attribute name="panel:icon" type="string" value="tgauge.png"/>



TH *

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