Name

XmQTaccessTextual — A widget holding this trait can display textual data

Synopsis

#include <Xm/AccTextT.h>

typedef struct {
        	int					version;
        	XmAccessTextualGetValuesProc    	getValue;
        	XmAccessTextualSetValuesProc    	setValue;
        	XmAccessTextualPreferredProc    	preferredFormat;
} XmAccessTextualTraitRec, *XmAccessTextualTrait;
XtPointer (*XmAccessTextualGetValuesProc)(, , void (*XmAccessTextualSetValuesProc), , , int (*XmAccessTextualPreferredProc));

DESCRIPTION

A widget holding the XmQTaccessTextual trait is capable of rendering one primary parcel of textual data. The primary parcel may consist of many lines (like in XmText) or only one line (like in XmTextField). However, if the widget renders more than one parcel of textual data (as does XmList), then the widget should not hold this trait.

The following standard Motif primitive widgets hold this trait:

  • XmText

  • XmTextField

  • XmLabel and all its subclasses

The following standard Motif manager widgets examine their child widgets for this trait:

  • XmComboBox

  • XmNotebook

  • XmSelectionBox

  • XmSpinBox

(See the source code for the ExmString demonstration widget for an example use of this trait.)

The getValue Trait Method

XtPointer getValue(widget, format);

The getValue trait method returns a copy of the textual data associated with widget widget in the format specified by format.

widget 

Specifies the widget holding this trait.

format 

Specifies the string format in which the method should return the data. The format must be one of the following: XmFORMAT_XmSTRING, XmFORMAT_MBYTE, or XmFORMAT_WCS.

This method returns a copy of the textual data in the format specified by format. The caller is responsible for managing the space allocated by the copy. If the format is XmFORMAT_XmSTRING, then the method returns an XmString cast to an XtPointer. If the format is XmFORMAT_MBYTE or XmFORMAT_WCS, then the method returns a char* cast to an XtPointer.

The setValue Trait Method

void setValue(widget, str, format);

A parent widget calls the setValue method to set the string data associated with child widget widget. The parent specifies both the string data (str) and the format of that string data.

widget 

Specifies the widget holding this trait.

str 

Specifies the string data to be associated with the child widget.

format 

Specifies the format of the string data. The format must be one of the following: XmFORMAT_XmSTRING, XmFORMAT_MBYTE, or XmFORMAT_WCS.

The preferredFormat Trait Method

int preferredFormat(widget);

A parent widget calls the preferredFormat method to find the format in which the child widget prefers to receive its string data.

widget 

Specifies the widget holding this trait.

This method returns the preferred string format of the child widget. The returned format must be one of the following: XmFORMAT_XmSTRING, XmFORMAT_MBYTE, or XmFORMAT_WCS.

RELATED

ExmString(3).