home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / windows / x / motif / 8051 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  1.6 KB

  1. Path: sparky!uunet!spool.mu.edu!olivea!charnel!rat!usc!rpi!cecchinr
  2. From: cecchinr@gehrig.cs.rpi.edu (Ron Cecchini)
  3. Newsgroups: comp.windows.x.motif
  4. Subject: Re: How to simulate a ToggleButton with a PushButton
  5. Message-ID: <34l266a@rpi.edu>
  6. Date: 16 Dec 92 16:09:26 GMT
  7. References: <16k2jrb@rpi.edu> <ADAM.92Dec15150234@node_48dc0.dadhb1.ti.com> <BzCv5o.rt@spss.com>
  8. Organization: Rensselaer Polytechnic Institute, Troy, NY
  9. Lines: 32
  10. Nntp-Posting-Host: gehrig.cs.rpi.edu
  11.  
  12. In article <BzCv5o.rt@spss.com> bobhays@spss.com (Bob Hays) writes:
  13.  
  14. [stuff deleted]
  15.  
  16. >Cute but doesn't answer the question - I hope the following will
  17. >help....
  18. >
  19. >You can replace the indicator pixmap for the toggle button using the
  20. >resources XmNselectPixmap and XmNselectInsensitivePixmap.  You may be
  21. >able to change the type of the indicator with XmNindicatorType.  Make
  22. >sure to turn the label off (XmNlabelString to (XmString) NULL).
  23. >
  24. >You will, with some toying, get the behavior you want (we do it here
  25. >for radio buttons with graphic images).
  26. >
  27. >Have fun! - Bob
  28.  
  29. Thanx Bob.  I also received a perhaps simpler bit of advice:
  30.  
  31. Use a ToggleButton, and set the following resources:
  32.      XmNindicatorOn, False
  33.      XmNshadowThickness, 1,
  34.  
  35. The only other thing left to do, since a ToggleButton doesn't have a
  36. XmNarmColor resource like a PushButton, is to change the ToggleButton's
  37. background resource in the ToggleButton's XmNarmCallback when it gets  pressed.
  38.  
  39. Of course, you also have to change the background back to its original color
  40. when the toggle somehow gets "deselected" (which in my case, since I've 
  41. implemented a "RadioBox", occurs when I press another ToggleButton).
  42.  
  43. Ron
  44.