g_signal_connect arguments




Hi all,

        I am new to GTK programming, and I've got a very simple question about
callbacks. In the application interface that I am encoding the next function
brings up a window containing several GtkEntries and a GtkCheckButton to gather
the options chosen by the user:

void menu_qdisc(){

..

GtkWidget *isRoot;
GtkWidget *entry1;
GtkWidget *entry2;

isRoot = gtk_check_button_new_with_label ("root qdisc");
entry1 = gtk_entry_new();
entry2 = gtk_entry_new();

..

g_signal_connect(G_OBJECT (button), "clicked", G_CALLBACK (callback_create), ???);

The problem is that I don't know how to define the signal_connect function as
all the examples that I've found only pass one widget parameter to the callback.
Should I pass the window containing all the widgets as an argument?

void callbackcreate(GtkWidget *boton, gpointer data){

..
        
}

And what is the way to read the user info from the widgets in the callback
function? 

Thank you very much for your help, and sorry if the topic appears to be too simple.


        Regards,

                Fran



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