[Glade-users] glade 3.6 and user data in callback function



IIRC there is a bug in GtkBuilder

try using a custom autoconnect function like this one

void
autoconnect_custom (GtkBuilder *builder,
                                        GObject *object,
                                        const gchar *signal_name,
                                        const gchar *handler_name,
                                        GObject *connect_object,
                                        GConnectFlags flags,
                                        gpointer data)
{
        GCallback func;
        static GModule *module = NULL;
        
        if (!module) module = g_module_open (NULL, 0);
        
        if (!g_module_symbol (module, handler_name, (gpointer)&func))
        {
                g_warning ("could not find signal handler '%s'.", handler_name);
                return;
        }
        
        g_signal_connect (object, signal_name, func,
                                          (connect_object) ? connect_object : data);
}

and auto connect whit something like this

gtk_builder_connect_signals_full (builder, autoconnect_custom, NULL);

greets

Juan Pablo





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