I have a non-modal dialog with 2 buttons->OK and Cancel
I use "g_signal_connect_swapped " execute a function when the user clicks one of the button or closes the dialog.
I can I know which button has been clicked?
It is a NON-MODAL Dialog, that mean, I cannot use the command
response = gtk_dialog_run()
Tanks a lot for your help in advance
dialog = gtk_message_dialog_new (main_application_window,
"Error loading file '%s': %s",
filename, g_strerror (errno));
/* Destroy the dialog when the user responds to it (e.g. clicks a button) */
g_signal_connect_swapped (dialog, "response", G_CALLBACK (cb_on_response), dialog);
static gboolean cb_on_response(GtkWidget *widget, gpointer data)
user has klicked CANCEL-> do this
user has klicked OK-> do that