Andrew,

Where are you with this problem now?  I have tried to review your posts
to better understand your dilemma, and I can make one suggestion in
reference to "add to gnome bar and it doesn't show anything".

When you have the *.server file correct, and your C code correct, in
that your printf's show console output.  Your issue may simply be that
you never added your widgets to the applet itself.  In GTK there is
always a top level window/widget which everything gets added to.  In a
gnome applet the applet itself is that top-level window.  This snippet
will attach your event_box widget to the applet, so it can be shown.

static gboolean
myexample_applet_fill (PanelApplet *applet,
   const gchar *iid,
   gpointer data)

{
...
gtk_container_add (GTK_CONTAINER(event_box),image);
gtk_container_add (GTK_CONTAINER (applet), event_box);
...
gtk_widget_show_all (GTK_WIDGET (applet));
...
}

James,
I think I sent you this link before; but here it is again - a skeleton
gnome applet program.
http://mysite.verizon.net/ressgdw8/sitebuildercontent/sitebuilderfiles/panel_applet-0.0-3.tar.bz2


On Mon, 2008-11-17 at 14:07 +0100, Andrew M. wrote:
> On Mon, November 17, 2008 7:48 am, Michael Ott wrote:
> > Hello Andrew!
> >
> >> >> I am attempting my first Gnome applet creation and I found a great
> tutorial at http://projects.gnome.org/ORBit2/appletstutorial.html .
> Unfortunately, I am stuck where the example goes to load an image. I
> >> can
> >> >> compile the applet and make it run but when I add it to the Gnome bar
> >> it
> >> >> doesn't show anything. I have some printf's in the code and those
> >> work
> >> >> on
> >> >> the console.
> >> > Do you have an .server file?
> >> >
> >> > Do you try it with panel-test-applets?
> >> >
> >> > With a server file and panel-test-applets it will work. Perhaps.
> >> I do indeed have the .server file.
> > Can you send me the file?
> 
> 
> <oaf_info>
> <oaf_server iid="OAFIID:ExampleApplet_Factory" type="exe"
>             location="/usr/lib/gnome-panel/myexample">
> 
>         <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="Example Applet
> Factory"/>
>         <oaf_attribute name="description" type="string" value="Factory to
> create the example applet"/>
> </oaf_server>
> 
> <oaf_server iid="OAFIID:ExampleApplet" type="factory"
>             location="OAFIID:ExampleApplet_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="Test2 Applet"/>
> <oaf_attribute name="description" type="string" value="This is a
> test"/>
>         <oaf_attribute name="panel:category" type="string"
> value="Amusements"/>
>         <oaf_attribute name="panel:icon" type="string"
> value="invest-big.png"/>
> </oaf_server>
> </oaf_info>
> 
> >
> >> From that same page I was able to make the first example work and do some
> >> small modifications. But when I try to go on to the second step,
> nothing happens. The applet runs from a command line and executes my
> printf()'s but nothing shows up on the panel.
> > I believe, that you cannot see anything on the panel. I tested it always
> with panel-test-applets.
> 
> I'm afraid I have no idea what panel-test-applets is..
> 
> Andrew
> 
> 
> 
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to