[ Usenet FAQs | Search | Web FAQs | Documents | RFC Index ]
    Search the FAQ Archives

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Part8 - Part9 - Single Page

Top Document: Motif FAQ (Part 6 of 9)
Previous Document: 171) Can I change or disable the menu bar accelerator from the
Next Document: 173) How can I determine the item selected in a a radio box or


172) How do I set the current choice in a radio box or an option


menu?
[Last modified: May 95]

Answer: Set the XmNmenuHistory resource on its XmRowColumn parent.

Ken Lee

buser@tartan.com (Mark) sent this code fragment:

Widget      menu;
int         num_buttons;
WidgetList  buttons;

XtVaGetValues( simple_option_widget, XmNsubMenuId, &menu, NULL);

XtVaGetValues( menu, XmNnumChildren, &num_buttons,
        XmNchildren, &buttons, NULL ) ;

and change current selection with:

XtVaSetValues( simple_option_widget, XmNmenuHistory, buttons[index], NULL ) ;

/* where index is between 0 and num_buttons */

Thanks to Phil Gehlich <pgehlich@hp7001.ecae.StorTek.COM> for a correction.



Top Document: Motif FAQ (Part 6 of 9)
Previous Document: 171) Can I change or disable the menu bar accelerator from the
Next Document: 173) How can I determine the item selected in a a radio box or

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Part8 - Part9 - Single Page


[ Usenet FAQs | Search | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
kenton@rahul.net (Ken Lee)

Last Update July 25 2008 @ 00:12 AM

© 2008 FAQS.ORG. All rights reserved.