Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Callbacks in GTK

Options
  • 29-05-2005 2:45pm
    #1
    Closed Accounts Posts: 680 ✭✭✭


    I have a gui written in GTK, and i need the buttons to perform certain tasks.

    If i have one button like this
    g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (callback), (gpointer) "button 1");
    and the callback looks like this
    static void callback( GtkWidget *widget, gpointer data )
    {
    }
    How do i get the callback function in to check a boolean in my main, and then if it is = true, add the "button 1" string of chars to another string? Do i have to add a second connect statement to the button and pass a pointer to the boolean?

    Any help appreciated.


Advertisement