[Vala] Glade auto_connect example doesn't work with 0.3.1 - update



Hi all,

****
I don't know why my previous e-mail still didn't come to the ml,
but meanwhile I tried something different :)
****

I am trying to build a glade application in Vala 0.3.1, but trying to
compile the Glade example I get the following error:

$ valac --pkg gtk+-2.0 --pkg libglade-2.0 glade.vala -o glade -X
"-Wl,--export-dynamic -rdynamic"

glade.vala:17.45-17.48: warning: Argument 1: Cannot pass null to
non-null parameter type

glade.vala:20.49-20.55: error: Argument 2: Cannot pass out argument to
non-output parameter


Lines 17-20 are:

17 GLib.Module module = GLib.Module.open(null, ModuleFlags.BIND_LAZY);
18 void* sym;
19              
20 if(!module.symbol(handler_name, out sym)) {



I managed to correct the first error, modifying glib-2.0.vapi, line 1299:

public static Module open (string? file_name, ModuleFlags @flags);

I simply added a "?" after string, as open accepts a null filename, meaning
it references to the current module.

The second error won't get away. I tried the impossible. :(

The only thing working is:

[InstanceLast]
public void connect_signals(string handler_name, GLib.Object object, string signal_name, string? signal_data, 
GLib.Object? connect_object, bool after) {
        
        GLib.Module module = GLib.Module.open(null, ModuleFlags.BIND_LAZY);
        void ** sym;
        
        module.symbol(handler_name, sym);
        
        if(sym != null) {
                stdout.printf("Symbol not found: %s\n", handler_name);
        } else {
                GLib.Signal.connect(object, signal_name, (GLib.Callback) sym, this);
        }
        
        stdout.printf("\n\n");
}

I added a couple "?" in the parameters, and removed "out" on
module.symbol(handler_name, out sym)
and made sym a pointer to pointer, as the vapi file says.

But still it doesn't work, giving me runtime errors:


(glade:7622): GModule-CRITICAL **: g_module_symbol: assertion `symbol != NULL' failed
Symbol not found: glade_on_quit


I don't know what else I could try. :/

Bye.





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