[Vala] About gnome applet example....



Hi everybody,

Sorry to disturb, but I have a strange error, vapi related I think. I
try to make a gnome applet...
I  know that's pretty difficult as libpannelapplet miss some function
call, but I don't want to wait until gnome 2.24 ... :P

Here my code :

using GLib;
using Panel;

public class MainApplet : GLib.Object {

        public bool panelFactory(Applet applet, string iid) {
                var button = new Gtk.Button.with_label("Vala Applet
Example");
                applet.add(button);
                applet.show_all();
                return false;
        }

        public static int main (string[] args) {
                var program = Gnome.Program.init ("Vala_Applet", "0",
Gnome.libgnomeui_module, args, args.length, "sm-connect", false);
                var ret = Panel.Applet.factory_main
("OAFIID:Vala_Applet_Factory", typeof(Panel.Applet),
MainApplet.panelFactory);
                return ret;
            }
}


It's just an adaptation of the Vala example
(http://live.gnome.org/Vala/PanelAppletSample) with 0.17 vapi syntax.
When I try to compile it, it's fail on gcc.

My terminal output :

heimdall lianli:~/Programmation/Vala$ valac --pkg gtk+-2.0 --pkg
libpanelapplet-2.0 -o pannel_applet pannel_applet.vala
pannel_applet.c: In function «main_applet_main":
pannel_applet.c:30: attention : passing argument 6 of
«gnome_program_init" makes pointer from integer without a cast
pannel_applet.c:31: erreur: expected expression before «)" token
pannel_applet.c:31: attention : passing argument 3 of
«panel_applet_factory_main" from incompatible pointer type
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)


Error on line 31 is interesting... I suppose it's come from the line 16
in my code :

var ret = Panel.Applet.factory_main ("OAFIID:Vala_Applet_Factory",
typeof(Panel.Applet), MainApplet.panelFactory);

But I'm stuck... and honestly, I don't even have an idea where the
problem is.

Did you any suggestions ?
Maybe I miss something ?




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