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