static gboolean generic_dialog_delete_cb(GtkWidget *w, GdkEventAny *event, gpointer data) { GenericDialog *gd = data; gboolean auto_close; auto_close = gd->auto_close; if (gd->cancel_cb) gd->cancel_cb(gd, gd->data); if (auto_close) generic_dialog_close(gd); return TRUE; }
static gboolean generic_dialog_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) { GenericDialog *gd = data; if (event->keyval == GDK_KEY_Escape) { if (gd->cancel_cb) gd->cancel_cb(gd, gd->data); else if (gd->auto_close) generic_dialog_click_cb(widget, data); return TRUE; } return FALSE; }