diff options
Diffstat (limited to 'app/wlib/gtklib/notice.c')
-rw-r--r-- | app/wlib/gtklib/notice.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/app/wlib/gtklib/notice.c b/app/wlib/gtklib/notice.c index b72afd6..0134b4f 100644 --- a/app/wlib/gtklib/notice.c +++ b/app/wlib/gtklib/notice.c @@ -58,8 +58,13 @@ static void doNotice( GtkWidget * widget, long value) { - noticeValue = value; - gtk_widget_destroy(noticeW.win); + if (value != 2) { + // event not from from closing the window but from a button press + // Close the Notice dialog + gtk_widget_destroy(noticeW.win); + // Remember the button + noticeValue = value; + } wlibDoModal(NULL, FALSE); } @@ -106,6 +111,8 @@ int wNoticeEx(int type, parent = GTK_WINDOW(gtkMainW->gtkwin); } + wDestroySplash(); + dialog = gtk_message_dialog_new(parent, GTK_DIALOG_DESTROY_WITH_PARENT, flag, @@ -113,6 +120,8 @@ int wNoticeEx(int type, "%s", msg); gtk_window_set_title(GTK_WINDOW(dialog), headline); + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); + res = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); @@ -174,6 +183,7 @@ int wNotice3( char *can = NULL; char *alt = NULL; + wDestroySplash(); nw->win = gtk_window_new(GTK_WINDOW_TOPLEVEL); @@ -243,6 +253,9 @@ int wNotice3( } } + g_signal_connect(GTK_WINDOW(nw->win), + "destroy", G_CALLBACK(doNotice), (void*)2); + gtk_widget_grab_default(nw->butt[ 0 ]); gtk_widget_grab_focus(nw->butt[ 0 ]); @@ -253,6 +266,7 @@ int wNotice3( /* gdk_window_set_group( nw->win->window, gtkMainW->gtkwin->window ); */ } + noticeValue = 0; // Default: Cancel wlibDoModal(NULL, TRUE); if (aff) { |