How to get a string in SelectionBox

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

2 posts / 0 new
Last post
How to get a string in SelectionBox

Submitted by Anonymous on Sun, 01/14/2001 - 21:58. Developers
Hello,

I try to get a string who appears in the textfield "Selection" in the widget SelectionBox.
I have not found the function.

For example, if this textfield contains the string "Parameters", I want to get this string and put it in a variable. What kind of variable?
Is it correct to write
XmString dest_string = string ;

Thank you very much for all answer.

ICS_support

It sounds like you`re looking for the XmNtextString resource, which reflects the string in the text edit selection field.

Getting this string is straight-forward, but you need to be aware that the XmSelectionBox, as a whole, has two mechanisms for making selections, and there is a second widget -- the list -- which also holds selection values which are in the process of being made.

Normally, and especially if the XmSelectionBox is in a dialog, you`d wait until you got a callback; you`d then use the value of the "value" field in the callback structure.

To get the value from the XmSelectionBox before that, you can retrieve the value from the widget, so you can call XtGetValues on the text widget, whose ID you can get by calling XmSelectionBoxGetChild and passing in the magic value XmDIALOG_TEXT. In the first case, you do get an XmString; in the second, the value is returned as a text string.