Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!rpi!julius.cs.uiuc.edu!apple!agate!ucbvax!MIRSA.INRIA.FR!Janet.Incerpi From: Janet.Incerpi@MIRSA.INRIA.FR (Janet Incerpi) Newsgroups: comp.windows.x.motif Subject: Re: A row/column or form problem Message-ID: <9101150950.AA27629@columbo.inria.fr> Date: 15 Jan 91 09:50:03 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 27 Yes, the Xform isn't exactly the most friendly object in the widget hierarchy. i wanted to do exactly the same thing, figuring it must be easy given what you see for the various selection boxes (3 buttons and perfect resizing). i considered the XmAttach_Position approach (suggested by Jeff Boote), this gets you almost there. Unfortunately you'd be attaching the left or right side of an object to a fixed (percentage) position. This doesn't work since what you want is the middle of the middle button attached to the middle of the form. My messy solution is to create a dummy button in the form. This button, which i arrange to have half the size of the middle button, is attached to the form, say on the right attachment using XmATTACH_POSITION=50. i then attach the middle button ("Close") to the dummy button. That is, use attach_opposite_widget so that the left side of the dummy and middle buttons are aligned. Now my middle button is perfect, except if you change the label. You can't have everything! The problem is in laying out widgets one sometimes need scaffolding and this is not provided for. Imagine that you did a drawing of what you wanted your object to look like, you'd draw a line in the form and position your Close button with the help of this line. After completing your drawing, you'd erase the line. My dummy widget is my scaffolding. It is a quick and dirty solution since i don't even erase my scaffolding, he's always there hidden by the middle button. A good motif programmer would probably write/do a geometry manager or some such. But alas, i'm not a good motif programmer, i specify stuff in UIL and my application is programmed in Lisp --- never a dull moment! --janet