[comp.windows.x.motif] Maintaining a square aspect ratio in an XmDrawingArea

montnaro@spyder.crd.ge.com (Skip Montanaro) (05/20/91)

I have a main window that consists of a form enclosing a menu bar and a
drawing area:

		+------------+
		|menu bar    |
		+------------+
		|drawing     |
		|area        |
		|            |
		|            |
		|            |
		+------------+

I want to force the drawing area to remain square at all times.  Ideally,
I'd like to force that at the window manager level, using the aspect ratio
resources in WMShell, but since the menu bar has a constant height, the
aspect ratio is not constant across resize operations. An alternative would
be to somehow force width and height resizes to match, but I believe the
widthInc and heightInc resources in WmShell are independent of one another.

My fallback has been to add a resize callback to the drawing area widget
that forces square dimensions. Unfortunately, I'm in a Catch-22 situation.
If I set the right and bottom attachments to XmATTACH_NONE, my resize
requests are honored (I just shrink the large dimension to match the small
one), however, unless they are set to XmATTACH_FORM, the drawing area widget
doesn't always get resize events. If they are set to XmATTACH_FORM, the form
ignores my resize requests and resizes the drawing area to fit the form's
dimensions.

Are there any other container widgets that will propagate resize events to
their children? I tried substituting a bulletin board for the form, but that
didn't seem to work.
--
Skip (montanaro@crdgw1.ge.com)