Using gpointer With Signals



I have something like this:

struct foo {
        ...
};

gint expose_handler(GtkWidget *window, gpointer data) {
        ...
};

int main() {
        struct foo bar;
        ...
        gtk_signal_connect(GTK_OBJECT(window), "expose_event",
GTK_SIGNAL_FUNC(expose_handler), &bar);
}

As you can see, I'm trying to pass 'bar' into expose_handler, but it
never gets there.  It's just a rogue pointer that throws segmentation
faults.  How do I fix this?

Thanks,

        Al Morgan [ almorgan pdxlinux org ]




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