Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!adobe!asente From: asente@adobe.com (Paul Asente) Newsgroups: comp.windows.x.motif Subject: Re: How do you center a widget within a form? Message-ID: <13302@adobe.UUCP> Date: 28 Mar 91 06:40:23 GMT References: Sender: news@adobe.COM Organization: Adobe Systems Inc. Lines: 18 In article montanaro@crdgw1.ge.com (Skip Montanaro) writes: > >All the *Attachment constraint resources in the XmForm widget relate to the >edges of the widget. Not knowing the size of the form and, say, a PushButton >widget (for instance, at creation time), how do you specify that the button >should be centered left-to-right within the form? You need to use two steps. First, create the pushbutton with left attachment to 50%. Then, do an XtGetValues to get the width of the pushbutton. Then, do an XtSetValues to make the left offset be -width/2. -paul asente asente@adobe.com ...decwrl!adobe!asente Ratz put a bucket of liquid in front of me. "I wanted a glass of docs, Ratz. What the hell is this?" I barked. "Motif don't fit in a glass anymore," he barked back. I looked at the liquid. It was totally opaque to me.