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

  1. Path: sparky!uunet!olivea!spool.mu.edu!umn.edu!csus.edu!netcom.com!richm
  2. From: richm@netcom.com (Richard Mauri)
  3. Newsgroups: comp.windows.x.motif
  4. Subject: Re:  Anyone got a Ruler Widget?
  5. Message-ID: <1992Dec28.155347.14708@netcom.com>
  6. Date: 28 Dec 92 15:53:47 GMT
  7. References: <9212231644.AA19754@bat.gsfc.nasa.gov>
  8. Distribution: inet
  9. Organization: Netcom Online Communications Services (408-241-9760 login: guest)
  10. Lines: 49
  11.  
  12. In article <9212231644.AA19754@bat.gsfc.nasa.gov> ks@BAT.GSFC.NASA.GOV (ASTS Ken Sall) writes:
  13. >
  14. > 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:
  15. > >> 
  16. > >> I am looking for a way to put rulers into a Motif
  17. > >> window.
  18. > >> 
  19. > >> For example, on the Mac, PageMaker and QuarkExpress both
  20. > >> have vertical and horizontal rulers.  I want implement
  21. > >> something very similar in Motif, but I don't know
  22. > >> where to start.
  23. > >> 
  24. >
  25. >Two different suggestions (I've successfully tried the second):
  26. >
  27. >1) Subclass off the XmDrawingArea widget and use XDrawLines and XDrawString or
  28. >   XDrawText to do implement the Expose method.
  29. >
  30. >2) Use XmScale widget with numerous children XmLabel widgets, one set for
  31. >   the tick marks (label: "|") and one set for the numerics. 
  32. >   Set the XmNshowValue resource to False.
  33. >   To get the widget id of the scrollbar portion of the scale:
  34. >   Do XtGetValues of XmNnumChildren and XmNchildren, loop over widget list
  35. >   returned to test for XmIsScrollBar (see ScrollBar.h), unmap the scrollbar
  36. >   widget (leaving the label children).
  37. >
  38. >------------------------------------------------------------------------
  39. >Ken Sall
  40. >ksall@cen.com                        ks@bat.gsfc.nasa.gov
  41. >
  42. >Century Computing, Inc.              TAE Plus project
  43. >Laurel, MD 20707                     under contract to:
  44. >(301) 953-3330                       NASA/Goddard Space Flight Center
  45. >------------------------------------------------------------------------
  46.  
  47. I believe it would be lots easier to subclass XmPrimitive than XmDrawingArea.
  48. Draw the scale, tick marks and anotations using Xlib primitives. I'm sure
  49. you'll have more control that way rather than wrestling with XmLabel 
  50. widgets, etc. You know, when I think of it I'd really like a ruler widget
  51. too. I'd like one that looked like the ruler in the legends on maps.
  52. Maybe I'll work on it myself. If anyone can tell me their requirements
  53. I will consider them in my design. If someome has done the work already
  54. let me know soon.
  55. Thanks, Rich Mauri
  56. -- 
  57. Richard Mauri               // Not ready to face the winter.
  58. SW Eng / X hack             // Pray for wind.
  59. Trimble Navigation Ltd.     // Pay the bills.
  60. richm@netcom.com        // Hope nothing breaks
  61.