Passing Struct to g_signal_connect




I need to pass a struct using g_signal_connect, but the issue I'm having is
that I can't alter the elements of the struct within the called function
e.g.

void on_button2_clicked (struct allStructs *by_ptr)

{
        gtk_label_set_text ((GtkLabel*)by_ptr->widgets.label, "whatever");
}

main
{
blah blah
struct allStructs baseStruct;

g_signal_connect (G_OBJECT(baseStruct.widgets.nextButton), "clicked",
G_CALLBACK (on_button2_clicked), &baseStruct);
}

Any idea's? If I pass this struct to any other function I have no problem
performing functions like in the callback. For some reason, I can't in the
callback.

-- 
View this message in context: 
http://www.nabble.com/Passing-Struct-to-g_signal_connect-tp20055372p20055372.html
Sent from the Gtk+ - Apps Dev mailing list archive at Nabble.com.




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