forked from AuroraMiddleware/gtk
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.
This commit is contained in:
parent
60dd9e5477
commit
2947596ca5
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user