Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

Motif FAQ (Part 6 of 9)
Section - 172) How do I set the current choice in a radio box or an option

( Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Part8 - Part9 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Airports ]


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
See reader questions & answers on this topic! - Help others by sharing your knowledge
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.

User Contributions:

Comment about this article, ask questions, or add new information about this topic:




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 | Web FAQs | Documents | RFC Index ]

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





Last Update March 27 2014 @ 02:11 PM