[comp.windows.x] Problem resizing widgets

bill@boulder.Colorado.EDU (06/29/89)

   I'm having a problem getting widgets to have the right
sizes, and I wonder if anybody can help me.  Probably I'm
missing something obvious, but I'm at my wits end, and the
documentation I have is too terse to do me much good.

   Background:  I'm working on an HP 350 under HP-UX 6.5 with
HP's version of X11 (which is R2), and HP's supplied widget set,
all standard and unmodified.

   I'm creating an interface for a neural simulator.  When a
certain button is clicked, I want to create a form widget (if
one already exists, I first destroy it), and then create a set
of panel widgets inside the form.  For each panel I also create
a title bar and a workspace.  

   Once the workspaces have been created, I call XtResizeWidget
on them, to make them the right sizes, but it doesn't work.  I've
tried every trick I could think of, and none of them work.  There 
is plenty of room for them in the application window, and I've set
all the "Resizable" and "causesResize" arguments I could find to
"True", and I tried resizing the form before creating the panels,
but all in vain.

   Strangely enough, if I click the button repeatedly, the panels
(which are being destroyed and recreated) come up with different
sizes each time.  They evolve through a series of forms, shrinking
and expanding.  From my reading of HP's documentation (which is not
easy to understand), I guess what might be happening is that the
widgets are trying to negotiate sizes, but instead of completing
the negotiation at the first creation, they carry it one step further
at each destruction-creation.  But that's just a guess.

   Anyway, my interface is useless if I can't control the sizes of
those panels.  Can anybody help me?

   thanks in advance,
		      Bill

ben@hpcvlx.HP.COM (Benjamin Ellsworth) (06/30/89)

> ...
>    Once the workspaces have been created, I call XtResizeWidget
> on them, to make them the right sizes, but it doesn't work.  I've
> tried every trick I could think of, and none of them work.

Try using XtSetValues (XtNwidth, XtNheight) instead of XtResizeWidget.

The HP widgets were written with the philosophy that the manager widget
has the final say regarding any of its children's sizes.  Having the
application calling XtResizeWidget subverts (i.e. breaks ;-) this
paradigm.  I believe that this paradigm (the parent controls the 
children's geometry, not the application) is the operative principle 
throughout the Xt Intrinsics.

> 		      Bill

-----------------------------------------------------------------------
Benjamin Ellsworth      | ben@cv.hp.com                | INTERNET
Hewlett-Packard Company | {backbone}!hplabs!hp-pcd!ben | UUCP
1000 N.E. Circle        | (USA) (503) 750-4980         | FAX
Corvallis, OR 97330     | (USA) (503) 757-2000         | VOICE
-----------------------------------------------------------------------
                     All relevant disclaimers apply.
-----------------------------------------------------------------------