XRT
I try to programatically set the currently selected item in a XRT/gear Combo
Box as follows:
<pre>
XtVaSetValues(combo,
XmNxrtGearPickListIndex, 2,
NULL);
</pre>
When I do a XtVaGetValues on the index, I get -999 as my picklist index. Why
is this?
When you do a GetValues on XmNxrtGearPickListIndex, the code performs the following steps:
1. If the field value matches the item at the picklist index, it returns the current picklist index value.
2. If the field value matches any item in the list it returns this picklist item index.
3. If none of the above it returns XRT_NOVALUE (-999)
So to ensure accurate reporting of the PickList index, make sure you set the index and the value at the same time, like this:
<pre>
XtVaSetValues(combo,
XmNxrtGearPickListIndex, 2,
XmNvalue, picklist[2],
NULL);
</pre>
© 2021 Quest Software Inc. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy