[comp.windows.x.motif] RESIZE_GROW

nazgul@alfalfa.com (Information Junkie) (04/24/91)

> 
> Another feature that apparently is not supported is an interface
> between the main window and the form/bulletin board to manage the
> scroll bars.  Currently if you set RESIZE_ANY and grow the window
> using the handles, the form does not grow with the main window parent.

I'm not sure if this is what you're refering to, but I had a problem
where I never wanted the child widget (a Table in this case) to be
smaller than the clip area of a scrolled window.

The hack to make this happen is to take the parent of the widget (which
will be an XmDrawingArea, since that's what XmScrolledWindow reparents
your widget to when you make it a child of an AUTOMATIC scrolled window)
and add a resize callback.  The callback can then check the size of
your widget, compare it to the size of the drawingarea, and do whatever's
appropriate.

The only thing you need to watch out for then is if the children of
your widget force it to be some other size that you don't want.  That's
where something like RESIZE_GROW comes in handy.  In the case of Table
I wanted a constant width and a varying height, so I had to add a
resizeWidth and resizeHeight resource so that I could constrain it to
ignore child requests in one direction or another.



Alfalfa Software, Inc.          |       Poste:  The EMail for Unix
nazgul@alfalfa.com              |       Send Anything... Anywhere
617/646-7703 (voice/fax)        |       info@alfalfa.com

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

wwang@osf.org ("Weidong Wang from OSF") (04/24/91)

Kee wrote:

  >  > 
  >  > Another feature that apparently is not supported is an interface
  >  > between the main window and the form/bulletin board to manage the
  >  > scroll bars.  Currently if you set RESIZE_ANY and grow the window
  >  > using the handles, the form does not grow with the main window parent.
  >  
  >  I'm not sure if this is what you're refering to, but I had a problem
  >  where I never wanted the child widget (a Table in this case) to be
  >  smaller than the clip area of a scrolled window.
  >  
  >  The hack to make this happen is to take the parent of the widget (which
  >  will be an XmDrawingArea, since that's what XmScrolledWindow reparents
  >  your widget to when you make it a child of an AUTOMATIC scrolled window)
  >  and add a resize callback.  The callback can then check the size of
  >  your widget, compare it to the size of the drawingarea, and do whatever's
  >  appropriate.
  >  
  >  The only thing you need to watch out for then is if the children of
  >  your widget force it to be some other size that you don't want.  That's
  >  where something like RESIZE_GROW comes in handy.  In the case of Table
  >  I wanted a constant width and a varying height, so I had to add a
  >  resizeWidth and resizeHeight resource so that I could constrain it to
  >  ignore child requests in one direction or another.
  >  

The current version of Motif does not support resizeLogicallyWidthParent. Kee
gave a work around to do it yourself. Of course, it would be nice to have it.

Send in an enhancement request.