[comp.windows.x.motif] Changing XmNrightOffset in a form widget

koch@cadfx.ccad.uiowa.edu (Peter Koch) (08/17/90)

I have a "Form" widget with labels attached to the left and right sides
The "Form" is inside another form. The "Form's" left side is attached 
to the left side of the enclosing form and the "Form's" right side is 
attached to the left side of the enclosing form with a negative right 
offset value.


What I am trying to do is have a push button, when activated, change the right 
offset value of the "Form". The only way I can get the offset value to change 
with XtSetArgs is to first unmanage the Form with the labels, change the right 
offset value, and then manage it again.

Is there any way to avoid unmanaging and then managing the "Form" to change the
XmNrightOffset resource?

ben@HPCVXBEN.CV.HP.COM (Benjamin Ellsworth) (08/17/90)

> Is there any way to avoid unmanaging and then managing the "Form" to
> change the XmNrightOffset resource?

Depends on the parent of the outer form.  My guess is that the offset
value is indeed being changed in the internal data structures, but when
the outer form tries to change size to accomodate the new values, its
parent says "No."  Hence no layout is performed.  I'd bet that if you
could jog size of the outer form you would see the layout you want.

I don't know of any neat work-arounds for this one in 1.0.  A sleazy
tactic that might work would be to call XtResizeWidget on the outer
form and resize it to its CURRENT (at the time of the call) size.

-----------------------------------------------------------------------
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.
-----------------------------------------------------------------------