diff options
Diffstat (limited to 'src/gtkext/easygtk.c')
-rw-r--r-- | src/gtkext/easygtk.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/gtkext/easygtk.c b/src/gtkext/easygtk.c index 11e17a4..fa99f38 100644 --- a/src/gtkext/easygtk.c +++ b/src/gtkext/easygtk.c @@ -876,3 +876,43 @@ GtkWidget *qck_create_tool_separator(GObject *object, const char *name) return result; } + + + + + + +/****************************************************************************** +* * +* Paramètres : parent = fenêtre parente pour la modalité d'affichage. * +* title = titre de la boîte de dialogue. * +* question = teneur de la question posée. * +* * +* Description : Affiche une boîte de dialogue offrant un choix "Oui/Non". * +* * +* Retour : Identifiant de la réponse choisie. * +* * +* Remarques : - * +* * +******************************************************************************/ + +gint qck_show_question(GtkWindow *parent, const char *title, const char *question) +{ + gint result; /* Choix arrêté à renvoyer */ + GtkWidget *dialog; /* Boîte de dialogue affichée */ + + dialog = gtk_message_dialog_new(parent, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_YES_NO, + question); + + gtk_window_set_title(GTK_WINDOW(dialog), title); + + result = gtk_dialog_run(GTK_DIALOG(dialog)); + + gtk_widget_destroy(dialog); + + return result; + +} |