[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 Widget Writer's Guide


XmQTaccessTextual

A widget holding this trait can display textual data

Format

#include <Xm/AccTextT.h>
 
typedef struct {
        	int					version;
        	XmAccessTextualGetValuesProc    	getValue;
        	XmAccessTextualSetValuesProc    	setValue;
        	XmAccessTextualPreferredProc    	preferredFormat;
} XmAccessTextualTraitRec, *XmAccessTextualTrait;
XtPointer
(*XmAccessTextualGetValuesProc)Widgetint
void
(*XmAccessTextualSetValuesProc)WidgetXtPointerint
int
(*XmAccessTextualPreferredProc)Widget

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:

  1. XmText

  2. XmTextField

  3. XmLabel and all its subclasses

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

    1. XmComboBox

    2. XmNotebook

    3. XmSelectionBox

    4. XmSpinBox

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

    5. The getValue Trait Method
      XtPointer getValueWidget
      widgetint 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 setValueWidget
      widgetXtPointer strint
      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 preferredFormatWidget
      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).


      [ Previous | Next | Contents | Glossary | Home | Search ]