Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!uunet!fmrco!sy18337 From: sy18337@fmrco (Terry Traub) Newsgroups: comp.windows.x.motif Subject: Re: Widget placement Keywords: pushbuttons form attachment Message-ID: <1991May24.150440.7923@fmrco> Date: 24 May 91 15:04:40 GMT Article-I.D.: fmrco.1991May24.150440.7923 References: <1991May23.184014.2329@dcs.simpact.com> Reply-To: sy18337@fmrco.UUCP (Terry Traub) Organization: Fidelity Investment, Boston, MA 02109 Lines: 33 In article <1991May23.184014.2329@dcs.simpact.com> kquick@dcs.simpact.com (Kevin Quick, Simpact Assoc., Inc.) writes: [...] >I have three PushButtons which would like similarly handled at the bottom >of a FormDialog. At the moment, I am using a form to contain them, but I >haven't been able to place the middle button specifically at the center of >the form; the closest I can come is to make its left attachment to a position >that I initially calculate to be at the correct location for the original >window size; resizing the FormDialog larger works fairly well, but larger >sizes show the button as no longer centered. Additionally, when the form >shrinks below optimal size, the buttons start to overlap and are not >restacked. [...] >Thanks in advance! > >-- > -- Kevin Quick, Simpact Associates, Inc., San Diego, CA. > UUCP: kquick@simpact.com (or simpact!kquick@crash.cts.com) Kevin, I've had some success using the following approach: If you have, say, 5 pushbuttons you want uniformly aligned horizontally, put them in a form and attach them to the top and bottom. Then leftAttach the leftmost button to the form, and rightAttach the rightmost button to the form. Then, the key thing is to make the rightAttachments of the first four buttons to be attachPosition, using some appropriate percentage of the distance, and make leftAttachment of the 2nd through 5th buttons attachWidget to the button to their left. Then your buttons will all resize correctly. Terry Traub Fidelity Investments Boston, Mass. ttraub@fmrco.UUCP (uunet!fmrco!lanyard!ttraub)