Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!usc!wuarchive!zaphod!think.com!linus!philabs!nbc1!nbc1!colin From: colin@nbc1.nbc1.ge.com (Colin Rafferty) Newsgroups: comp.windows.x.motif Subject: Re: A row/column or form problem Message-ID: Date: 14 Jan 91 18:24:11 GMT References: <10361@bunny.GTE.COM> <9896@ncar.ucar.edu> Sender: colin@nbc1.ge.com (Colin Rafferty) Organization: National Broadcasting Company, New York City Lines: 55 In-Reply-To: boote@bierstadt.scd.ucar.edu's message of 11 Jan 91 20:27:03 GMT In article <9896@ncar.ucar.edu> boote@bierstadt.scd.ucar.edu (Jeff W. Boote) writes: > In article <10361@bunny.GTE.COM>, xev@GTE.COM (Xev Gittler) writes: >> I tried a form, with OK and HELP attached to their respective >> sides, and CLOSE attached to OK and HELP, but then CLOSE >> grows when the form is resized, instead of the space between >> the widget growing. > > Try attaching CLOSE with XmATTACH_POSITION instead of attaching it to > the other widgets. This should give it a relative position within the > form. See the Programmers ref under XmForm. Using XmATTACH_POSITION is the right idea, but if you use it for one side of CLOSE, then it's not centered. If you use it for both sides of CLOSE, then you still get the button growing. What you need to do is have a new widget called CENTER which has height and width of 0, and uses XmATTACH_POSITION of 50. You then use XmATTACH_WIDGET to attach CLOSE to CENTER. Here is the relevent uil code: object Center : XmSeparator widget { arguments { XmNseparatorType = XmNO_LINE; XmNheight = 0; XmNwidth = 0; XmNleftAttachment = XmATTACH_POSITION; XmNleftPosition = 50; XmNrightAttachment = XmATTACH_POSITION; XmNrightPosition = 50; }; }; object Close : XmPushButton widget { arguments { XmNlabelString = 'Close'; XmNleftAttachment = XmATTACH_WIDGET; XmNleftWidget = XmSeparator Center; XmNleftOffset = - (buttonWidth / 2); XmNrightAttachment = XmATTACH_WIDGET; XmNrightWidget = XmSeparator Center; XmNrightOffset = - (buttonWidth / 2); }; }; -- -- Colin Owen Rafferty | "Life is so complex, parts colin@nbc1.ge.com | of it must be imaginary." {philabs,crdgw1,ge-dab}!nbc1!colin | -Tim Thiel (I don't speak for NBC. Watch Tom Brokaw for that.) -- -- Colin Owen Rafferty | "Life is so complex, parts colin@nbc1.ge.com | of it must be imaginary."