[Vala] GtkActionEntry Vapi Issue



Howdy All,

   In populating an array of Gtk.ActionEntry struct instances in
user-interface setup code, I've encountered an issue, as illustrated by the
following code snippet:

    Gtk.ActionEntry[] common_actions = new Gtk.ActionEntry[1];
    ...
    /* code here sets up the name, stock_id, label, accelerator and tooltip
fields of common_actions[0] */
    ...
    common_actions[0].callback = on_action_quit;

where "on_action_quit" is a method in the same class with the signature void
on_action_quit(Gtk.Action).

When I run the build toolchain, valac runs fine, but gcc generates an error
compiling the resulting C code, saying "error: ‘GtkActionCallback’
undeclared (first use in this function)." So let's take a look at the
resulting C code, where I've marked the offending line with an "<<<<<."

...
#line 297 "AppWindow.vala"
AppWindow* app_window_construct (GType object_type) {
#line 1040 "AppWindow.c"
    AppWindow * self;
    AppWindow* _tmp1_;
    AppWindow* _tmp0_;
    GtkActionCallback _tmp2_; <<<<<
    GdkPixbuf* _tmp3_;
    self = (AppWindow*) page_window_construct (object_type);
...

As you can clearly see, valac generates a reference to the name
"GtkActionCallback." This isn't surprising, given that the vala name
Gtk.ActionCallback is mapped as such in gtk+-2.0.vapi.

There is one major problem with this mapping, however: the name
"GtkActionCallback" does not exist. It isn't declared anywhere, in any of
the C-language Gtk+ 2.0 header files that the Vapi bindings are based on.

Since Gtk.ActionEntry structures are a major feature in Gtk/GNOME user
interfaces, I'm sure that others have encountered this problem before. Any
suggested workarounds, pointers to vapi fixes in the pipeline, or assistance
of any other kind would be much appreciated.

Regards,
Lucas


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