This patch fixes the default-no feature when using the gtk2
features of Xdialog.
Patch by Gilbert Ashley <amigo@ibiblio.org>

diff -pruN Xdialog-2.3.1/src/interface.c Xdialog-2.3.1-yesno/src/interface.c
--- Xdialog-2.3.1/src/interface.c   2011-02-27 19:12:59.000000000 +0100
+++ Xdialog-2.3.1-yesno/src/interface.c   2011-02-27 19:16:06.000000000 +0100
@@ -742,7 +742,9 @@ static void set_timeout(void)
 void create_msgbox(gchar *optarg, gboolean yesno)
 {
    GtkWidget *hbuttonbox;
-
+   GtkWidget *button;
+   gboolean flag;
+   
    open_window();
 
    set_backtitle(TRUE);
@@ -758,8 +760,19 @@ void create_msgbox(gchar *optarg, gboole
             set_button(CANCEL , hbuttonbox, 1, FALSE);
          set_button(NEXT, hbuttonbox, 0, TRUE);
       } else {
-         set_button(YES, hbuttonbox, 0, !Xdialog.default_no);
-         set_button(NO , hbuttonbox, 1, Xdialog.default_no);
+         button = set_button(OK, hbuttonbox, 0, flag = !Xdialog.default_no);
+         if (flag)
+            gtk_widget_grab_focus(button);
+         
+         if (Xdialog.cancel_button) {
+            button = set_button(CANCEL, hbuttonbox, 1, flag = Xdialog.default_no );
+            if (flag)
+               gtk_widget_grab_focus(button);
+         } else {
+            button = set_button(NO, hbuttonbox, 1, flag = Xdialog.default_no );
+            if (flag)
+               gtk_widget_grab_focus(button);
+         }
       }
    } else
       set_button(OK, hbuttonbox, 0, TRUE); 