gtk_toggle_button_get_active() error in clicked event?



Hi!

void on_element_clicked (GtkButton *button, gpointer user_data) {
    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) {
        g_warning("good");
    }
    else {
        g_warning("wrong");
    }
}

If clicked element is toggled, output: "good". But if clicked element
is not toggled, output: "wrong" and "good". Why running twice? This is
GTK+ bug?


Thanks:
Kurucz István



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