Is this OK?

Great free software developers! 

Beginers question: 

g_signal_connect (G_OBJECT (button_cancel), 
            G_CALLBACK (kstudentnew_quit_cb), 
            main_window); /* this is main window the button is in */ 

void kstudentnew_quit_cb (GtkWidget *widget, gpointer callback_data) 
    gtk_widget_destroy ((GtkWidget *)callback_data);/* destroy main
    window */ 

is this OK? 

Can I cast callback_data like this? Main window is not main for app, but
for entry dialog for some data. When user cancel this window it calls
this callback. Is there cleaner way, or can go with this one?

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