Name

ExmString — The String widget class

Synopsis

#include <Exm/String.h>

DESCRIPTION

ExmString is a demonstration widget. OSF provides this widget solely to teach programmers how to write their own Motif widgets. OSF does not support this widget in any way.

The source code for the ExmString widget illustrates how to do the following:

  • Use the recommended resources for handling compound strings

  • Install the XmQTaccessTextual trait and define its trait methods

  • Calculate the baselines of each line of text in the compound string

ExmString is similar to the standard Motif toolkit widget XmLabel. The major difference between ExmString and XmLabel is that XmLabel can display either text or a pixmap, but ExmString can display only text.

ExmString is an instantiable widget and is also used as a superclass for other widgets, such as ExmCommandButton, ExmStringTransfer, and ExmMenuButton.

The ExmString widget receives enter and leave events, but it does not accept any button or key input.

The help callback is the only callback defined.

The text displayed by ExmString is a noneditable compound string. The ExmNcompoundString resource holds the value of this compound string. (See the Motif Programmer's Guide for more information on compound strings.) The text can be multilingual, multiline, and/or multifont. When an ExmString is insensitive, its text is stippled.

Unlike XmLabel, ExmString does not support accelerators or mnemonics.

ExmString forces the XmNtraversalOn resource to False.

Classes

ExmString inherits behavior and resources from Core, XmPrimitive, and ExmSimple.

The class pointer is exmStringWidgetClass.

The class name is ExmString.

New Resources

The following table defines a set of widget resources used by the programmer to specify data. The programmer can also set the resource values for the inherited classes to set attributes for this widget. To reference a resource by name or by class in a .Xdefaults file, remove the XmN, ExmN, XmC or ExmC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the Xm or Exm prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). The codes in the "Access" column indicate if the given resource can be set at creation time (C), set by using XtSetValues (S), retrieved by using XtGetValues (G), or is not applicable (N/A).

ExmString Resource Set
NameClassTypeDefaultAccess
ExmNcompoundStringExmCCompoundStringXmStringNULLCSG
XmNalignmentXmCAlignmentunsigned charXmALIGNMENT_CENTERCSG
XmNrecomputeSizeXmCRecomputeSizeBooleanTrueCSG
XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG

ExmNcompoundString 

Specifies the text to be displayed.

XmNalignment 

Specifies the alignment of the text:

XmALIGNMENT_BEGINNING (left alignment) 

Causes the left sides of the lines of text to be aligned with the left edge of the widget window.

XmALIGNMENT_CENTER (center alignment) 

Causes each line of text to be centered half way between the left and right edges of the widget window.

XmALIGNMENT_END (right alignment) 

Causes the right sides of the lines of text to be aligned with the right edge of the widget window.

The preceding descriptions for text are correct when XmNstringDirection is XmSTRING_DIRECTION_L_TO_R. When that resource is XmSTRING_DIRECTION_R_TO_L, the descriptions for XmALIGNMENT_BEGINNING and XmALIGNMENT_END are switched.

XmNrecomputeSize 

Specifies a Boolean value that indicates whether the widget attempts to resize to accommodate its contents as a result of an XtSetValues resource value that would change the size of the widget. If True, the widget attempts to shrink or expand to exactly fit the compound string. If False, the widget never attempts to change size on its own.

XmNrenderTable 

Specifies the render table of the text used in the widget. If this value is NULL at initialization, the parent hierarchy of the widget is searched for an ancestor that holds the XmQTspecifyRenderTable trait. If such an ancestor is found, the font list is initialized to XmNbuttonRenderTable (for button subclasses) or XmNlabelRenderTable of the ancestor widget. If no such ancestor is found, the default is implementation dependent. Refer to XmRenderTable(3) for more information on the creation and structure of a font list.

Inherited Resources

ExmString inherits behavior and resources from the following superclasses. For a complete description of each resource, refer to the reference page for that superclass.

ExmSimple Resource Set
NameClassTypeDefaultAccess
ExmNsimpleShapeExmCSimpleShapeunsigned charExmSHAPE_OVALCSG
XmNmarginHeightXmCMarginHeightDimension4CSG
XmNmarginWidthXmCMarginWidthDimension4CSG

XmPrimitive Resource Set
NameClassTypeDefaultAccess
XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG
XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
XmNconvertCallbackXmCCallbackXtCallbackListNULLC
XmNforegroundXmCForegroundPixeldynamicCSG
XmNhelpCallbackXmCCallbackXtCallbackListNULLC
XmNhighlightColorXmCHighlightColorPixeldynamicCSG
XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG
XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG
XmNhighlightThicknessXmCHighlightThicknessDimension2CSG
XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG
XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG
XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC
XmNshadowThicknessXmCShadowThicknessDimension2CSG
XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG
XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG
XmNtraversalOnXmCTraversalOnBooleanFalseCSG
XmNunitTypeXmCUnitTypeunsigned chardynamicCSG
XmNuserDataXmCUserDataXtPointerNULLCSG

Core Resource Set
NameClassTypeDefaultAccess
XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG
XmNancestorSensitiveXmCSensitiveBooleandynamicG
XmNbackgroundXmCBackgroundPixeldynamicCSG
XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG
XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
XmNborderWidthXmCBorderWidthDimension0CSG
XmNcolormapXmCColormapColormapdynamicCG
XmNdepthXmCDepthintdynamicCG
XmNdestroyCallbackXmCCallbackXtCallbackListNULLC
XmNheightXmCHeightDimensiondynamicCSG
XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC
XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG
XmNscreenXmCScreenScreen *dynamicCG
XmNsensitiveXmCSensitiveBooleanTrueCSG
XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG
XmNwidthXmCWidthDimensiondynamicCSG
XmNxXmCPositionPosition0CSG
XmNyXmCPositionPosition0CSG

Translations

ExmString inherits all the translations of XmPrimitive. ExmString does not provide any additional translations beyond those defined by XmPrimitive.

Action Routines

ExmString provides no action routines of its own.

RELATED

Core(3), ExmCommandButton(3), ExmMenuButton(3), ExmSimple(3), and XmPrimitive(3).