home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!udel!intercon!psinntp!dg-rtp!webo!dg-webo!larry
- From: larry@boris.webo.dg.com (Larry Rogers)
- Newsgroups: comp.windows.x.motif
- Subject: Re: Centering button in form ?
- Message-ID: <LARRY.92Dec22164941@boris.webo.dg.com>
- Date: 22 Dec 92 21:49:41 GMT
- References: <1992Dec22.175107.3484@news.dfrf.nasa.gov>
- Sender: usenet@webo.dg.com (Usenet Administration)
- Organization: Data General, Westboro, Mass.
- Lines: 52
- In-Reply-To: todd@fred.dfrf.nasa.gov's message of Tue, 22 Dec 1992 17:51:07 GMT
-
-
- Here is an example in Wcl showing the resource values that need to be
- set to center a widget, without resizing it, within a form. There are
- alternate solutions in the FAQ. This one works and is tested with
- Motif 1.1.3.
-
- Mri*title: Center that Widget
- Mri.wcChildren: form
-
- ! Create a form of width and height 200, 200. This width and height
- ! are arbitrary. Set 'em to whatever you like.
-
- *form.wcClass: xmFormWidgetClass
- *form.wcChildren: push
- *form.width: 200
- *form.height: 200
-
- ; To center the button, set top and left attachment to attach_position
- ;
- ; Set top and left position to 50% of form width and height based on
- ; a fractionBase of 100.
- ;
- ; Set the topOffset to 1/2 the height of the widget
- ; Set the leftOffset to 1/2 the width of the widget
- ; Because these are moving the widget negatively WRT center,
- ; the values are negative.
- ;
-
- *push.wcClass: xmPushButtonWidgetClass
- *push.labelString: Hello World
- *push.activateCallback: WcExitCB()
- *push.topAttachment: ATTACH_POSITION
- *push.leftAttachment: ATTACH_POSITION
- *push.topPosition: 50
- *push.leftPosition: 50
- *push.recomputeSize: FALSE
- *push.width: 120
- *push.height: 30
- *push.leftOffset: -60
- *push.topOffset: -15
-
- --
- @@ Larry Rogers *
- @@@ Larry_Rogers@dg.com * Big Brother
- @@@ &&& larry@boris.webo.dg.com * is Watching
- @@ && Data General 508-870-8441 *
-
- The opinions contained herein are my own, and do not reflect the
- opinions of Data General or anyone else, but they should.
-
- "Sometimes we are the windshield, sometimes we are the bug"
- Dire Straits
-