home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / windows / x / motif / 8141 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.6 KB  |  49 lines

  1. Newsgroups: comp.windows.x.motif
  2. Path: sparky!uunet!think.com!paperboy.osf.org!juliet!daniel
  3. From: daniel@juliet.osf.org (Daniel Dardailler)
  4. Subject: Re: HELP!  I'm having a problem with XmScale Widgets
  5. Message-ID: <1992Dec21.143639.9981@osf.org>
  6. Sender: daniel@juliet (Daniel Dardailler)
  7. Organization: Open Software Foundation, Motif Team
  8. References:  <BzG4o2.L2C@usenet.ucs.indiana.edu>
  9. Date: Mon, 21 Dec 1992 14:36:39 GMT
  10. Lines: 37
  11.  
  12.  
  13. |> I can use XtSetSensitive to make the widget read-only, but then the title string is grayed out.  Supposedly this can be changed with the stipple-bitmap, but I have been unable to find a resource to set this....  Also, how do you get tick marks on the scal|> e? 
  14.  
  15.  
  16. First the sensitivity.
  17.  
  18. If you want to gray only the scrollbar out, you need to write some code.
  19. Something like:
  20.  
  21. void SetScrollBarSensitivity (Widget scale, Boolean sensitive)
  22.  {
  23.     Arg args[4] ;
  24.     Cardinal n ;
  25.     Widget * children ;
  26.  
  27.     n = 0;
  28.     XtSetArg (args[n], XmNchildren, &children);  n++;
  29.     XtGetValues (scale, args, n);
  30.  
  31.     XtSetSensitive(children[1], sensitive);
  32.  }
  33.  
  34. has to be called whenever you do a SetValues on the scale.
  35. (this is a bug, scrollbar sensitivity should only be reset to
  36. the scale one when the later is changed - I'll fix that asap).
  37.  
  38. Now for the tick marks.
  39.  
  40. Scale is a manager widget, which automatically creates 2 children : a title
  41. and a scrollbar, and let you add as many application children as you want,
  42. by layouting them in an evenly spread out way along the scrollbar.
  43.  
  44. So if you want scale tick marks, you can either add N separator gadgets or 
  45. widgets to the scale, or 1 drawing area where you could draw you're own
  46. marks.
  47.  
  48.  
  49.