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

  1. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!gatech!usenet.ins.cwru.edu!agate!ucbvax!BAT.GSFC.NASA.GOV!ks
  2. From: ks@BAT.GSFC.NASA.GOV (ASTS Ken Sall)
  3. Newsgroups: comp.windows.x.motif
  4. Subject: Re:  Anyone got a Ruler Widget?
  5. Message-ID: <9212231644.AA19754@bat.gsfc.nasa.gov>
  6. Date: 23 Dec 92 16:44:37 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Distribution: inet
  9. Organization: The Internet
  10. Lines: 33
  11.  
  12.  
  13.  uunet!ucbvax.Berkeley.EDU!agate!spool.mu.edu!uwm.edu!zaphod.mps.ohio-state.edu!usc!news.cerf.net!benton.prepress.com!benton!mark  (Mark S. Bubien) writes:
  14.  >> 
  15.  >> I am looking for a way to put rulers into a Motif
  16.  >> window.
  17.  >> 
  18.  >> For example, on the Mac, PageMaker and QuarkExpress both
  19.  >> have vertical and horizontal rulers.  I want implement
  20.  >> something very similar in Motif, but I don't know
  21.  >> where to start.
  22.  >> 
  23.  
  24. Two different suggestions (I've successfully tried the second):
  25.  
  26. 1) Subclass off the XmDrawingArea widget and use XDrawLines and XDrawString or
  27.    XDrawText to do implement the Expose method.
  28.  
  29. 2) Use XmScale widget with numerous children XmLabel widgets, one set for
  30.    the tick marks (label: "|") and one set for the numerics. 
  31.    Set the XmNshowValue resource to False.
  32.    To get the widget id of the scrollbar portion of the scale:
  33.    Do XtGetValues of XmNnumChildren and XmNchildren, loop over widget list
  34.    returned to test for XmIsScrollBar (see ScrollBar.h), unmap the scrollbar
  35.    widget (leaving the label children).
  36.  
  37. ------------------------------------------------------------------------
  38. Ken Sall
  39. ksall@cen.com                        ks@bat.gsfc.nasa.gov
  40.  
  41. Century Computing, Inc.              TAE Plus project
  42. Laurel, MD 20707                     under contract to:
  43. (301) 953-3330                       NASA/Goddard Space Flight Center
  44. ------------------------------------------------------------------------
  45.