Skip to Content

Two arguments passed to a GTK callback???

Hi, I'm kind of new in GTK programming and I would like to do the following: I have to insert a dialpad in a existing application and In my dialpad button clicked callback, I would need two arguments. And it looks like it's not possible. Here is my code:

void my_code_function( GtkWidget* dw ) .. button = gtk_buttonnew_with_label( "A" ); g_signal_connect( G_OBJECT(button), "clicked", GTK_SIGNAL_FUNCTION( keypad_cb), (gpointer) dw); ...

const void keypad_cb (GtkWidget* button, gpointer dw) ... here I need dw. Ok bnecause it's passed as an argument I would also need the buttonlabel (here "A") because there will be several buttons and the action will depend on which one is clicked! ...

Thanks for any suggestion. Cheers Bill_oute

MSameer's picture

You need the clicked button t

You need the clicked button to be passed to the callback ? If this is what you want then this is the condition already ;-)

Quote "yes she took her cake to become small so we can fit into the rabbit hole .. i`m already small aho even u can`t c me :P"

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Dr. Radut | forum