Re: gnome applets with gtkmm



On Sat, 2006-17-06 at 20:59 +0200, Dodji Seketeli wrote:
> Hello,
> 
> I am not sure if there are up to date bindings to the applets api but
> you can use the C API to write your applet and keep the widgets used
> in the applet in gtkmm.
> 
> There is a tutorial for the C API at
> http://www.gnome.org/projects/ORBit2/appletstutorial.html .
> 
> Hope this helps,

Dodji,

Thanks for that. Yes it helped :)

I got the GTK+ version working but I have no idea how to convert it to
GTKMM. Here is what I have:

#include <string.h>

#include <panel-applet.h>
#include <gtk/gtklabel.h>

static gboolean
myexample_applet_fill (PanelApplet *applet,
   const gchar *iid,
   gpointer data)
{
	GtkWidget *label;

	if (strcmp (iid, "OAFIID:ExampleApplet") != 0)
		return FALSE;

	label = gtk_label_new ("Hello World");
	gtk_container_add (GTK_CONTAINER (applet), label);

	gtk_widget_show_all (GTK_WIDGET (applet));

	return TRUE;
}

PANEL_APPLET_BONOBO_FACTORY ("OAFIID:ExampleApplet_Factory",
                             PANEL_TYPE_APPLET,
                             "The Hello World Applet",
                             "0",
                             myexample_applet_fill,
                             NULL);

How do I convert this to GTKMM and how do I compile it? (With current
one I compiled with this command: gcc $(pkg-config --cflags --libs
libpanelapplet-2.0) -o my_applet my_applet.c )

Thanks,
-Gezim


> Dodji.
> 
> On 6/17/06, Gezim Hoxha <gezimetc shaw ca> wrote:
> > Hi all.
> >
> > Could someone provide me with a mini-howto on writing gnome applets with
> > gtkmm? I googled this but not much came up.
> >
> > Thanks,
> > -Gezim
> >
> > _______________________________________________
> > gtkmm-list mailing list
> > gtkmm-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> >




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