[fj.windows.x] Athena Box

yuki@flab.fujitsu.co.jp (Hiroyuki YOSHIDA) (08/23/90)

We use X11R4 (fix-11).

The situation is as follows:

(1) A toplevel shell widget is created and realized.
(2) A box widget is created and managed as one of descendants of the
    toplevel.
(3) A label widget is created but NOT managed as a child of the box.
(4) When another label widget is created, managed, and mapped, an
    error occurs and the program exits. This is because the second
    label has no window (probably is NOT realized).

To demonstrate the situation, here is a context diff of examples/Xaw/xboxes.c.

*** /usr/local/src/X11R4/mit/examples/Xaw/xboxes.c	Sat Dec 16 09:33:10 1989
--- xboxes.c	Thu Aug 23 17:48:30 1990
***************
*** 133,138 ****
--- 133,139 ----
       * Put a bunch of smaller boxes in the outer box.
       */
  
+     XtRealizeWidget(toplevel);
      for (i = 1; i <= app_resources.num_boxes; i++) {
  	char name[BUFSIZ];
  	
***************
*** 140,146 ****
  	MakeBox(box, (String) name);
      }
  
-     XtRealizeWidget(toplevel);
      XtAppMainLoop(app_con);
  }
  
--- 141,146 ----
***************
*** 161,167 ****
      
      box = XtCreateManagedWidget(name, boxWidgetClass, parent, NULL, ZERO);
  
!     (void) XtCreateManagedWidget(name, labelWidgetClass, box, NULL, ZERO);
  
      for ( i = 0; i < 3; i++)
  	(void) XtCreateManagedWidget("label", labelWidgetClass, box,NULL,ZERO);
--- 161,167 ----
      
      box = XtCreateManagedWidget(name, boxWidgetClass, parent, NULL, ZERO);
  
!     (void) XtCreateWidget(name, labelWidgetClass, box, NULL, ZERO);
  
      for ( i = 0; i < 3; i++)
  	(void) XtCreateManagedWidget("label", labelWidgetClass, box,NULL,ZERO);
--
Hiroyuki Yoshida
yuki@flab.fujitsu.co.jp
yuki%flab.fujitsu.co.jp@uunet.uu.NET