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