diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-10-04 12:44:21 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-10-04 12:44:21 +0200 |
| commit | d437236479bcd911e9f2215670299f6abc49206b (patch) | |
| tree | ade97b958d7bd13102e95253d782973977405be9 | |
| parent | c04230ac95cf53ce73a4c7872e6eb64aeeba9668 (diff) | |
| download | tuxcmd-d437236479bcd911e9f2215670299f6abc49206b.tar.xz | |
Focus default choice button in the "do-not-show-again" dialog
| -rw-r--r-- | UGnome.pas | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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)); |
