summaryrefslogtreecommitdiff
path: root/UGnome.pas
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2009-10-04 12:44:21 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2009-10-04 12:44:21 +0200
commitd437236479bcd911e9f2215670299f6abc49206b (patch)
treeade97b958d7bd13102e95253d782973977405be9 /UGnome.pas
parentc04230ac95cf53ce73a4c7872e6eb64aeeba9668 (diff)
downloadtuxcmd-d437236479bcd911e9f2215670299f6abc49206b.tar.xz
Focus default choice button in the "do-not-show-again" dialog
Diffstat (limited to 'UGnome.pas')
-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));