[comp.windows.x] help needed with constraint widgets

lockheed@Hudson.Stanford.EDU (Lockheed) (07/06/90)

I'm using HP's X Widgets, X11R3, and SPARCstation. I'm new to widget
programming, so excuse me if I use wrong terminologies. Here is my problem.

I have a tree constraint widget, XstreeWidget, with a constraint
resource, XtNsuperNode. I initially create a tree like the following:

  n1 -- n2 -- n3

Lets refer to the constraint widget and its children as TREE, N1, N2, and
N3, respectively. I want to change this to:

       +-- n2
  n1 --+
       +-- n3

by executing:

    XtSetArg(args[0], XtNsuperNode, n1);
    XtSetValues(n3, args, 1);

Then, XstreeWidget will change the link and layout the new tree. When I
trace the above, XtSetValues calls GeometryManager of XstreeWidget,
although the children of TREE did not explicitly request for geometry
change anywhere in the XstreeWidget code. What's wierder is that N3's
window gets moved to the right place (right below N2); however, its
internal x-y position gets reset to its original place.

As you may know, XstreeWidget is from D. Young's `X Window Systems
Programming...' book. If you have the code from the book and try out the
above case, you'll know what I mean.

I was able to overcome the above problem by having GeometryManager always
honor geometry requests and returning XtGeometryYes, but I would like to
know why the above is happening.

If any widget wizards out there can shad some light, I'd be grateful.
Thanks in advance.

Ik
ik@laic.lockheed.com