changeset 25754:d4de526fb0e0

(wm_delete_window): Check all the shell's children, not just the first, to find the dialog box.
author Richard M. Stallman <rms@gnu.org>
date Sat, 18 Sep 1999 03:02:03 +0000
parents 4e71424cd40b
children 93cef6bdf4a6
files lwlib/lwlib-Xaw.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lwlib/lwlib-Xaw.c	Fri Sep 17 20:57:37 1999 +0000
+++ b/lwlib/lwlib-Xaw.c	Sat Sep 18 03:02:03 1999 +0000
@@ -501,16 +501,22 @@
      XtPointer call_data;
 {
   LWLIB_ID id;
+  Cardinal nkids;
+  int i;
   Widget *kids = 0;
   Widget widget;
   if (! XtIsSubclass (shell, shellWidgetClass))
     abort ();
+  XtVaGetValues (shell, XtNnumChildren, &nkids, 0);
   XtVaGetValues (shell, XtNchildren, &kids, 0);
   if (!kids || !*kids)
     abort ();
-  widget = kids [0];
-  if (! XtIsSubclass (widget, dialogWidgetClass))
-    abort ();
+  for (i = 0; i < nkids; i++)
+    {
+      widget = kids[i];
+      if (XtIsSubclass (widget, dialogWidgetClass))
+	break;
+    }
   id = lw_get_widget_id (widget);
   if (! id) abort ();