title: How should I use X11, motif, DrawingArea, and c++ to set the DrawingArea (X,Y) coordinate (0,0)
body: <p>I am trying to work with DrawingAreas and things aren't working the way I expected.</p>
  
  <pre><code>#include &lt;Xm/Xm.h&gt;
  #include &lt;Xm/DrawingA.h&gt;
  
  main(int argc, char *argv[])
  {
    Widget shell, workArea, box1;
    XtAppContext app;
    shell = XtVaAppInitialize(&amp;app, "gp", NULL, 0, &amp;argc, argv, NULL, XmNwidth, 500, XmNheight, 500, NULL);
    XtRealizeWidget(shell);
  
    workArea = XtCreateWidget("wa",xmDrawingAreaWidgetClass, shell, NULL, 0);
    XtVaSetValues(workArea, XmNbackground, 30000, NULL);
  
    box1 = XtCreateWidget("b1", xmDrawingAreaWidgetClass, workArea, NULL, 0);
    XtVaSetValues(box1, XmNx, 0, XmNy, 0, XmNwidth, 400, XmNheight, 400, NULL);
  
    XtManageChild(workArea);
    XtManageChild(box1);
    //XtAppMainLoop(app);
    XEvent event;
    Dimension x,y,w,h;
    while(1)
    {
      XtAppNextEvent(app, &amp;event);
      if (event.type == EnterNotify)
      {
        XtVaGetValues(box1, XmNx, &amp;x, XmNy, &amp;y, XmNwidth, &amp;w, XmNheight, &amp;h, NULL);
        printf("(x,y,w,h) == (%d,%d,%d,%d)\n", x, y, w, h);
      }
      if (event.type == LeaveNotify)
      {
        XtVaSetValues(box1, XmNx, 0, XmNy, 0, XmNwidth, 400, XmNheight, 400, NULL);
        printf("tried to set (x,y,w,h) = (0,0,400,400)\n");
      }
      XtDispatchEvent(&amp;event);
    }
  }
  </code></pre>
  
  <p>When I enter the window and leave the window with my pointer I get output:</p>
  
  <pre><code>(x,y,w,h) == (10,10,400,400)
  (x,y,w,h) == (10,10,400,400)
  tried to set (x,y,w,h) = (0,0,400,400)
  tried to set (x,y,w,h) = (0,0,400,400)
  (x,y,w,h) == (10,10,400,400)
  (x,y,w,h) == (10,10,400,400)
  tried to set (x,y,w,h) = (0,0,400,400)
  tried to set (x,y,w,h) = (0,0,400,400)
  </code></pre>
  
  <p>Why doesn't the XtVaSetValues set box1 to (X,Y) = (0,0)?  How can I accomplish placing a Drawing area at (0,0) within the window?</p>
  
  <p>I figured out the answer but don't have the reputation to provide it:</p>
  
  <pre><code>XtManageChild(box1);
  XtUnmanageChild(box1);
  XtVaSetValues(box1, XmNx, 0, XmNy, 0, XmNwidth, 400, XmNheight, 400, NULL);
  XtMapWidget(box1);
  </code></pre>