home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / windows / x / motif / 8182 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  2.1 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!udel!intercon!psinntp!dg-rtp!webo!dg-webo!larry
  2. From: larry@boris.webo.dg.com (Larry Rogers)
  3. Newsgroups: comp.windows.x.motif
  4. Subject: Re: Centering button in form ?
  5. Message-ID: <LARRY.92Dec22164941@boris.webo.dg.com>
  6. Date: 22 Dec 92 21:49:41 GMT
  7. References: <1992Dec22.175107.3484@news.dfrf.nasa.gov>
  8. Sender: usenet@webo.dg.com (Usenet Administration)
  9. Organization: Data General, Westboro, Mass.
  10. Lines: 52
  11. In-Reply-To: todd@fred.dfrf.nasa.gov's message of Tue, 22 Dec 1992 17:51:07 GMT
  12.  
  13.  
  14. Here is an example in Wcl showing the resource values that need to be
  15. set to center a widget, without resizing it, within a form.  There are
  16. alternate solutions in the FAQ.  This one works and is tested with
  17. Motif 1.1.3.
  18.  
  19. Mri*title: Center that Widget 
  20. Mri.wcChildren:        form
  21.  
  22. !  Create a form of width and height 200, 200.  This width and height
  23. !  are arbitrary.  Set 'em to whatever you like.
  24.  
  25. *form.wcClass:    xmFormWidgetClass
  26. *form.wcChildren: push
  27. *form.width: 200
  28. *form.height: 200
  29.  
  30. ; To center the button, set top and left attachment to attach_position
  31. ;
  32. ; Set top and left position to 50% of form width and height based on
  33. ; a fractionBase of 100.
  34. ; Set the topOffset to 1/2 the height of the widget
  35. ; Set the leftOffset to 1/2 the width of the widget
  36. ; Because these are moving the widget negatively WRT center,
  37. ;  the values are negative.
  38. ;
  39.  
  40. *push.wcClass:        xmPushButtonWidgetClass
  41. *push.labelString:    Hello World
  42. *push.activateCallback:    WcExitCB()
  43. *push.topAttachment: ATTACH_POSITION
  44. *push.leftAttachment: ATTACH_POSITION
  45. *push.topPosition: 50
  46. *push.leftPosition: 50
  47. *push.recomputeSize: FALSE
  48. *push.width: 120
  49. *push.height: 30
  50. *push.leftOffset: -60
  51. *push.topOffset: -15
  52.  
  53. --
  54.     @@               Larry Rogers               *
  55.    @@@               Larry_Rogers@dg.com        *   Big Brother
  56.    @@@ &&&           larry@boris.webo.dg.com    *   is Watching
  57.     @@ &&            Data General  508-870-8441 * 
  58.  
  59. The opinions contained herein are my own, and do not reflect the
  60. opinions of Data General or anyone else, but they should.
  61.  
  62. "Sometimes we are the windshield, sometimes we are the bug"
  63.    Dire Straits
  64.