home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x.motif,80,articles
- Path: sparky!uunet!wupost!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watmath!undergrad.math.waterloo.edu!napier.uwaterloo.ca!cpbeaure
- From: cpbeaure@napier.uwaterloo.ca (Chris Beauregard)
- Subject: Re: controlling an option menu from within the program (summary)
- Message-ID: <C0Frr8.Hvz@undergrad.math.waterloo.edu>
- Keywords: option menu
- Sender: news@undergrad.math.waterloo.edu
- Organization: University of Waterloo
- References: <1992Dec30.205716.17673@gate.esat.kuleuven.ac.be> <1993Jan6.102718.2140@gate.esat.kuleuven.ac.be>
- Date: Wed, 6 Jan 1993 14:18:43 GMT
- Lines: 35
-
- In article <1993Jan6.102718.2140@gate.esat.kuleuven.ac.be> johanb@joyce.esat.kuleuven.ac.be (Johan Buelens) writes:
- >many thanks to everybody who responded ! as jasper@einstein.com pointed
- >out, `The menuHistory resource must be set to the XmPushButton *widget* that
- >you want to be selected.'
- >
- >you can use the convenience functions to create the option menu, but then
- >you have to find out the names of the pushbutton widgets and the menu widget;
- >it then seems more appropriate to create the menu `the hard way' (without
- >convenience function), so you are in control of all the widget names.
- [code deleted]
-
- While this works, it's a real pain if you have a good number of menus to
- deal with.
-
- I've written a small (<10 lines of code) to set the button of an option
- menu just given the number of the wanted button (0-(n-1), n being the
- number of buttons entries in the menu) So you can basically use
-
- XmOptionMenuButton(widget,buttonNumber);
-
- Unfortunately, the code for the routine is at work. I'm afraid I can't
- telnet there to get it (don't ask...).
-
- Basically you grab the sublist of button widgets (using XtVaGetValues -
- I don't remember the resource), and then get the widget id of the
- buttonNumber needed. Use that when you set menuHistory. I think you
- might also have to unmanage and manage the widget again.
-
- If I get some time today (ugh!) I'll take a quick shot at working the
- code out and post it...
-
- >Johan H. BUELENS
-
- Chris Beauregard cpbeaure@napier.uwaterloo.ca
- Warning: These premises protected by reality.
-