From 9eed7020e9f40578172010ca8df3703e74a03f0b Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 2 Jul 2015 12:57:37 -0400 Subject: [PATCH] Implemented uiMsgBox() and uiMsgBoxError() on the GTK+ backend. I think that's all of the GTK+ backend done now... --- redo/unix/stddialogs.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/redo/unix/stddialogs.c b/redo/unix/stddialogs.c index 99d4fa35..962957c5 100644 --- a/redo/unix/stddialogs.c +++ b/redo/unix/stddialogs.c @@ -38,10 +38,24 @@ char *uiSaveFile(void) return filedialog(GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_SAVE); } +static void msgbox(const char *title, const char *description, GtkMessageType type, GtkButtonsType buttons) +{ + GtkWidget *md; + + md = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, + type, buttons, + "%s", title); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(md), "%s", description); + gtk_dialog_run(GTK_DIALOG(md)); + gtk_widget_destroy(md); +} + void uiMsgBox(const char *title, const char *description) { + msgbox(title, description, GTK_MESSAGE_OTHER, GTK_BUTTONS_OK); } void uiMsgBoxError(const char *title, const char *description) { + msgbox(title, description, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK); }