summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--UGnome.pas7
1 files changed, 5 insertions, 2 deletions
diff --git a/UGnome.pas b/UGnome.pas
index 709da4a..71b8a37 100644
--- a/UGnome.pas
+++ b/UGnome.pas
@@ -1198,6 +1198,7 @@ const TMessageStyleID : array[0..3] of TGtkMessageType = (GTK_MESSAGE_ERROR, GTK
var Dialog: PGtkWidget;
CheckBox: PGtkCheckButton;
i: integer;
+ w: PGtkWidget;
begin
if Application.Terminated then
begin
@@ -1210,8 +1211,10 @@ begin
gtk_widget_show(PGtkWidget(CheckBox));
gtk_box_pack_end(GTK_BOX(GTK_DIALOG(Dialog).vbox), PGtkWidget(CheckBox), False, False, 12);
for i := 1 to NumMessageButtons do
- if TMessageButton(i - 1) in Buttons
- then gtk_dialog_add_button(PGtkDialog(Dialog), MessageButtonID[i], i);
+ if TMessageButton(i - 1) in Buttons then begin
+ w := gtk_dialog_add_button(PGtkDialog(Dialog), MessageButtonID[i], i);
+ if TMessageButton(i - 1) = Default then gtk_widget_grab_focus(w);
+ end;
if Escape <> mbNone then g_signal_connect(PGtkObject(Dialog), 'key-press-event', G_CALLBACK(@Gnome_MessageBox_key_press_event),
Pointer(Ord(Escape) + 1{MessageButtonID[Ord(Escape)]}));
if Default <> mbNone then gtk_dialog_set_default_response(PGtkDialog(Dialog), Ord(Default));