status dock howto
- From: Stefan Strigler <steve zeank in-berlin de>
- To: gnome-devel-list gnome org
- Subject: status dock howto
- Date: 27 Apr 2002 22:16:23 +0200
Hi there,
I'm trying to include a status-docklet in my existing app but just don't
get it. I'm really stuck.
Here's an example of what I'm trying to do:
%<---<schnipp>---
gnurps:/tmp$ more docklet.c
#include <status-docklet.h>
GtkObject *status;
static void
build_our_plug (StatusDocklet *docklet, GtkWidget *plug, gpointer data)
{
GtkWidget *label;
g_print ("build_our_plug called\n");
/* an extremely simple status, you probably want an icon */
label = gtk_label_new("#");
gtk_widget_show(label);
/* add the status to the plug */
gtk_container_add(GTK_CONTAINER(plug), label);
}
int
main (int argc, char *argv[])
{
gnome_init ("dockapp","0.1",argc,argv);
/* in your main function you would do something like */
status = status_docklet_new();
/* connect our widget building function */
gtk_signal_connect(GTK_OBJECT(status), "build_plug",
GTK_SIGNAL_FUNC(build_our_plug),
NULL);
/* "run" the docklet */
g_print ("starting applet ...");
status_docklet_run (STATUS_DOCKLET(status));
g_print (" done.\n");
gtk_main ();
return 0;
}
%<---<schnapp>---
compiled it with:
gnurps:/tmp$ gcc -g -Wall `gnome-config --libs --cflags docklets` -o
docklet docklet.c
but then:
gnurps:/tmp$ ./docklet
starting applet ...
** CRITICAL **: file orbitns.c: line 254 (gnome_name_service_get):
assertion `_gnorba_gnome_orbit_orb' failed.
** ERROR **: file goad.c: line 660 (real_goad_server_activate):
assertion failed: (name_service != CORBA_OBJECT_NIL)
aborting...
Abgebrochen
gnurps:/tmp$
What's wrong with it? I really looked hard for an easy example anywhere
but couldn't find one (the code is taken from the api-doc).
Greets,
Steve
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]