Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XmPrimitive(3Xm) — RISC iX 1.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

Core(3Xm)

XmPrimitive(3Xm)  —  UNIX Programmer’s Manual

NAME

XmPrimitive — the Primitive widget class.

SYNOPSIS

#include <Xm/Xm.h>

DESCRIPTION

Primitive is a widget class used as a supporting superclass for other widget classes.  It handles border drawing and highlighting, traversal activation and deactivation, and various callback lists needed by Primitive widgets. 

Classes

Primitive inherits behavior and resources from Core class. 

The class pointer is xmPrimitiveWidgetClass. 

The class name is XmPrimitive. 

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 or XmC prefix and use the remaining letters.  To specify one of the defined values for a resource in a .Xdefaults file, remove the Xm prefix and use the remaining letters (in either lower case or upper case, 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). 

XmPrimitive Resource Set
Name Class Type Default Access
XmNbottomShadowColor XmCForeground Pixel dynamic CSG
XmNbottomShadowPixmap XmCBottomShadowPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNforeground XmCForeground Pixel dynamic CSG
XmNhelpCallback XmCCallback XtCallbackList NULL C
XmNhighlightColor XmCForeground Pixel Black CSG
XmNhighlightOnEnter XmCHighlightOnEnter Boolean False CSG
XmNhighlightPixmap XmCHighlightPixmap Pixmap dynamic CSG
XmNhighlightThickness XmCHighlightThickness short 0 CSG
XmNshadowThickness XmCShadowThickness short 2 CSG
XmNtopShadowColor XmCBackground Pixel dynamic CSG
XmNtopShadowPixmap XmCTopShadowPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNtraversalOn XmCTraversalOn Boolean False CSG
XmNunitType XmCUnitType unsigned char XmPIXELS CSG
XmNuserData XmCUserData caddr_t NULL CSG

XmNbottomShadowColor
Specifies the pixmap to use to draw the top and left sides of the border shadow.

XmNbottomShadowPixmap
Specifies the pixmap to use to draw the bottom and right sides of the border shadow.

XmNforeground
Specifies the foreground drawing color used by Primitive widgets.

XmNhelpCallback
Specifies the list of callbacks that is called when the help key sequence is pressed.  The reason sent by the callback is XmCR_HELP.  There is not a translation bound to this resource.  It is up to the application to install a translation for help. 

XmNhighlightColor
Specifies the color of the highlighting rectangle. This color is used if the highlight pixmap resource is XmUNSPECIFIED_PIXMAP. 

XmNhighlightOnEnter
Specifies if the highlighting rectangle is drawn when the cursor moves into the widget.  If this resource is True and XmNtraversalOn is False, then the rectangle highlights the window when the cursor is moved into it.  This resource is ignored if the XmNtraversalOn resource is set to True. 

XmNhighlightPixmap
Specifies the pixmap used to draw the highlighting rectangle.

XmNhighlightThickness
Specifies the thickness of the highlighting rectangle.

XmNshadowThickness
Specifies the size of the drawn border shadow.

XmNtopShadowColor
Specifies the pixmap to use to draw the top and left sides of the border shadow.  This color is used if the XmNtopShadowPixmap resource is NULL. 

XmNtopShadowPixmap
Specifies the pixmap to use to draw the top and left sides of the border shadow.

XmNtraversalOn
Specifies if traversal is activated for this widget.

XmNunitType
Provides the basic support for resolution independence. It defines the type of units a widget will use with sizing and positioning resources.  Unless the XmNunitType resource is explicitly set, it will default to the unit type of the parent widget.  If the parent has a unit type of Xm100TH_POINTS, then any of its children whose XmNunitType resource is not set will also have a unit type of Xm100TH_POINTS.  This feature applies only to widgets whose parents are a subclass of XmManager.  Widgets whose parents are not subclasses of XmManager will have a unit type of XmPIXELS. 

XmNunitType can have the following values:

•XmPIXELS — all values provided to the widget are treated as normal pixel values.  This is the default for the resource. 

•Xm100TH_MILLIMETERS — all values provided to the widget are treated as 1/100 millimeter. 

•Xm1000TH_INCHES — all values provided to the widget are treated as 1/1000 inch. 

•Xm100TH_POINTS — all values provided to the widget are treated as 1/100 point.  A point is a unit typically used in text processing applications and is defined as 1/72 inch. 

•Xm100TH_FONT_UNITS — all values provided to the widget are treated as 1/100-font unit.  The value to be used for the font unit is determined in one of two ways.  The resource XmNfont can be used in a defaults file or on the command line.  The standard command line options of -fn and -font can also be used.  The font unit value is taken as the QUAD_WIDTH property of the font.  The function XmSetFontUnits allows applications to specify the font unit values. 

XmNuserData
Allows the application to attach any necessary specific data to the widget. It is an internally unused resource.

Dynamic Color Defaults

The foreground, background, top shadow, and bottom shadow resources are dynamically defaulted.  If no color data is specified, the colors are automatically generated.  On a monochrome system, a black and white color scheme is generated.  On a color system, a set of four colors are generated which display the correct shading for the 3-D visuals. 

If the background is the only color specified for a widget, the top shadow, bottom shadow, and foreground colors are generated to give the 3-D appearance.  The color generation works best with non-saturated colors.  Using pure red, green, or blue yields poor results. 

Colors are generated at creation only.  Resetting the background through XtSetValues will not regenerate the other colors. 

Inherited Resources

Primitive inherits behavior and resources from the following superclass.  For a complete description of these resources, refer to the man page for that superclass. 

Core Resource Set
Name Class Type Default Access
XmNaccelerators XmCAccelerators XtTranslations NULL CSG
XmNancestorSensitive XmCSensitive Boolean True G
XmNbackground XmCBackground Pixel dynamic CSG
XmNbackgroundPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNborderColor XmCBorderColor Pixel Black CSG
XmNborderPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNborderWidth XmCBorderWidth Dimension 0 CSG
XmNcolormap XmCColormap Colormap XtCopyFromParent CG
XmNdepth XmCDepth int XtCopyFromParent CG
XmNdestroyCallback XmCCallback XtCallbackList NULL C
XmNheight XmCHeight Dimension 0 CSG
XmNmappedWhenManaged XmCMappedWhenManaged Boolean True CSG
XmNscreen XmCScreen Pointer XtCopyScreen CG
XmNsensitive XmCSensitive Boolean True CSG
XmNtranslations XmCTranslations XtTranslations NULL CSG
XmNwidth XmCWidth Dimension 0 CSG
XmNx XmCPosition Position 0 CSG
XmNy XmCPosition Position 0 CSG

Behavior

Shift<Key>Tab:
Moves the focus to the first item contained within the previous tab group. If the beginning of the tab group list is reached, it will wrap to the end of the tab group list.

<Key>Tab:
Moves the focus to the first item contained within the next tab group.  If the current tab group is the last entry in the tab group list, it will wrap to the beginning of the tab group list.

<Key>Up or <Key>Left:
Moves the keyboard focus to the previous Primitive widget or gadget within the current tab group.  The previous widget or gadget is the one which is the previous entry in the tab group’s list of children.  Wrapping will occur, if necessary.

<Key>Down or <Key>Right:
Moves the Keyboard focus to the next Primitive widget or gadget within the current tab group.  The previous widget or gadget is the one which is the next entry in the tab group’s list of children.  Wrapping will occur, if necessary.

<Key>Home:
Moves the keyboard focus to the first Primitive widget or gadget in the current tab group.

Default Translations

The following are the default translations for Primitive:

<FocusIn>:PrimitiveFocusIn()
<FocusOut>:PrimitiveFocusOut()
<Unmap>:PrimitiveUnmap()
Shift<Key>Tab:PrimitivePrevTabGroup()
<Key>Tab:PrimitiveNextTabGroup()
<Key>Up:PrimitiveTraversePrev()
<Key>Down:PrimitiveTraverseNext()
<Key>Left:PrimitiveTraversePrev()
<Key>Right:PrimitiveTraverseNext()
<Key>Home:PrimitiveTraverseHome()

RELATED INFORMATION

Core(3Xm). 

7th Edition

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026