From 2947596ca533860dbebdb4c5d4d8fe76b6ebdab7 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 31 Jan 2002 16:13:12 +0000 Subject: [PATCH] Try to make sure that we have some focused widget on map. (#50339) Wed Jan 30 13:55:59 2002 Owen Taylor * gtk/gtkwindow.c (gtk_window_show): Try to make sure that we have some focused widget on map. (#50339) * gtk/gtkdialog.c (gtk_dialog_map): Handling picking a focus widget here differently so that if a response button gets picked, it's the default one. * tests/testgtk.c (make_message_dialog): Set the default response for the dialogs. --- tests/testgtk.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/testgtk.c b/tests/testgtk.c index 1a87cd4d52..667eef0442 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -3570,7 +3570,8 @@ create_modal_window (void) static void make_message_dialog (GtkWidget **dialog, GtkMessageType type, - GtkButtonsType buttons) + GtkButtonsType buttons, + guint default_response) { if (*dialog) { @@ -3591,7 +3592,9 @@ make_message_dialog (GtkWidget **dialog, "destroy", GTK_SIGNAL_FUNC (gtk_widget_destroyed), dialog); - + + gtk_dialog_set_default_response (GTK_DIALOG (*dialog), default_response); + gtk_widget_show (*dialog); } @@ -3603,10 +3606,10 @@ create_message_dialog (void) static GtkWidget *error = NULL; static GtkWidget *question = NULL; - make_message_dialog (&info, GTK_MESSAGE_INFO, GTK_BUTTONS_OK); - make_message_dialog (&warning, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE); - make_message_dialog (&error, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK_CANCEL); - make_message_dialog (&question, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO); + make_message_dialog (&info, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, GTK_RESPONSE_OK); + make_message_dialog (&warning, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, GTK_RESPONSE_OK); + make_message_dialog (&error, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK_CANCEL, GTK_RESPONSE_OK); + make_message_dialog (&question, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, GTK_RESPONSE_YES); } /*