diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-01-31 16:13:12 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2002-01-31 16:13:12 +0000 |
commit | 2947596ca533860dbebdb4c5d4d8fe76b6ebdab7 (patch) | |
tree | 931aa002e9cfc8c0924db7e586e4944191acfe6a /tests | |
parent | 60dd9e54771725febb82d14c740cfe282a54961b (diff) | |
download | gtk+-2947596ca533860dbebdb4c5d4d8fe76b6ebdab7.tar.gz |
Try to make sure that we have some focused widget on map. (#50339)
Wed Jan 30 13:55:59 2002 Owen Taylor <otaylor@redhat.com>
* 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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testgtk.c | 15 |
1 files 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); } /* |