Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

Composite(3X)

Constraint(3X)

Core(3X)

XmCreateDrawingArea(3X)

XmManager(3X)

XmDrawingArea(3X)  —  Subroutines

OSF/Motif

NAME

XmDrawingArea − The DrawingArea widget class

SYNOPSIS

#include <Xm/DrawingA.h>

DESCRIPTION

DrawingArea is an empty widget that is easily adaptable to a variety of purposes. It does no drawing and defines no behavior except for invoking callbacks. Callbacks notify the application when graphics need to be drawn (exposure events or widget resize) and when the widget receives input from the keyboard or mouse. 

Applications are responsible for defining appearance and behavior as needed in response to DrawingArea callbacks. 

DrawingArea is also a composite widget and subclass of XmManager that supports minimal geometry management for multiple widget or gadget children. 

Classes

DrawingArea inherits behavior and resources from the Core, Composite, Constraint, and XmManager classes. 

The class pointer is xmDrawingAreaWidgetClass. 

The class name is XmDrawingArea. 

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 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). 

XmDrawingArea Resource Set

XmNexposeCallback

Class: XmCCallback
Default: NULL
Type:  XtCallbackList
Access: C

XmNinputCallback

Class: XmCCallback
Default: NULL
Type:  XtCallbackList
Access: C

XmNmarginHeight

Class: XmCMarginHeight
Default: 10
Type:  Dimension
Access: CSG

XmNmarginWidth

Class: XmCMarginWidth
Default: 10
Type:  Dimension
Access: CSG

XmNresizeCallback

Class: XmCCallback
Default: NULL
Type:  XtCallbackList
Access: C

XmNresizePolicy

Class: XmCResizePolicy
Default: XmRESIZE_ANY
Type:  unsigned char
Access: CSG

XmNexposeCallback
Specifies the list of callbacks that is called when DrawingArea receives an exposure event. The callback reason is XmCR_EXPOSE.  The callback structure also includes the exposure event. 

The default bit gravity for Manager windows is NorthWestGravity. This may cause the XmNexposeCallback procedures not to be invoked when the DrawingArea window is made smaller. 

XmNinputCallback
Specifies the list of callbacks that is called when the DrawingArea receives a keyboard or mouse event (key or button, up or down). The callback reason is XmCR_INPUT. The callback structure also includes the input event. 

XmNmarginHeight
Specifies the minimum spacing in pixels between the top or bottom edge of DrawingArea and any child widget.

XmNmarginWidth
Specifies the minimum spacing in pixels between the left or right edge of DrawingArea and any child widget.

XmNresizeCallback
Specifies the list of callbacks that is called when the DrawingArea is resized. The callback reason is XmCR_RESIZE. 

XmNresizePolicy
Controls the policy for resizing DrawingArea widgets. Possible values include XmRESIZE_NONE (fixed size), XmRESIZE_ANY (shrink or grow as needed), and XmRESIZE_GROW (grow only). 

Inherited Resources

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

XmManager Resource Set

XmNbottomShadowColor

Class: XmCBottomShadowColor
Default: dynamic
Type:  Pixel
Access: CSG

XmNbottomShadowPixmap

Class: XmCBottomShadowPixmap
Default: XmUNSPECIFIED_PIXMAP
Type:  Pixmap
Access: CSG

XmNforeground

Class: XmCForeground
Default: dynamic
Type:  Pixel
Access: CSG

XmNhelpCallback

Class: XmCCallback
Default: NULL
Type:  XtCallbackList
Access: C

XmNhighlightColor

Class: XmCHighlightColor
Default: dynamic
Type:  Pixel
Access: CSG

XmNhighlightPixmap

Class: XmCHighlightPixmap
Default: dynamic
Type:  Pixmap
Access: CSG

XmNinitialFocus

Class: XmCInitialFocus
Default: NULL
Type:  Widget
Access: CSG

XmNnavigationType

Class: XmCNavigationType
Default: XmTAB_GROUP
Type:  XmNavigationType
Access: CSG

XmNshadowThickness

Class: XmCShadowThickness
Default: 0
Type:  Dimension
Access: CSG

XmNstringDirection

Class: XmCStringDirection
Default: dynamic
Type:  XmStringDirection
Access: CG

XmNtopShadowColor

Class: XmCTopShadowColor
Default: dynamic
Type:  Pixel
Access: CSG

XmNtopShadowPixmap

Class: XmCTopShadowPixmap
Default: dynamic
Type:  Pixmap
Access: CSG

XmNtraversalOn

Class: XmCTraversalOn
Default: True
Type:  Boolean
Access: CSG

XmNunitType

Class: XmCUnitType
Default: dynamic
Type:  unsigned char
Access: CSG

XmNuserData

Class: XmCUserData
Default: NULL
Type:  XtPointer
Access: CSG

Composite Resource Set

XmNchildren

Class: XmCReadOnly
Default: NULL
Type:  WidgetList
Access: G

XmNinsertPosition

Class: XmCInsertPosition
Default: NULL
Type:  XtOrderProc
Access: CSG

XmNnumChildren

Class: XmCReadOnly
Default: 0
Type:  Cardinal
Access: G

Core Resource Set

XmNaccelerators

Class: XmCAccelerators
Default: dynamic
Type:  XtAccelerators
Access: CSG

XmNancestorSensitive

Class: XmCSensitive
Default: dynamic
Type:  Boolean
Access: G

XmNbackground

Class: XmCBackground
Default: dynamic
Type:  Pixel
Access: CSG

XmNbackgroundPixmap

Class: XmCPixmap
Default: XmUNSPECIFIED_PIXMAP
Type:  Pixmap
Access: CSG

XmNborderColor

Class: XmCBorderColor
Default: XtDefaultForeground
Type:  Pixel
Access: CSG

XmNborderPixmap

Class: XmCPixmap
Default: XmUNSPECIFIED_PIXMAP
Type:  Pixmap
Access: CSG

XmNborderWidth

Class: XmCBorderWidth
Default: 0
Type:  Dimension
Access: CSG

XmNcolormap

Class: XmCColormap
Default: dynamic
Type:  Colormap
Access: CG

XmNdepth

Class: XmCDepth
Default: dynamic
Type:  int
Access: CG

XmNdestroyCallback

Class: XmCCallback
Default: NULL
Type:  XtCallbackList
Access: C

XmNheight

Class: XmCHeight
Default: dynamic
Type:  Dimension
Access: CSG

XmNinitialResourcesPersistent

Class: XmCInitialResourcesPersistent
Default: True
Type:  Boolean
Access: C

XmNmappedWhenManaged

Class: XmCMappedWhenManaged
Default: True
Type:  Boolean
Access: CSG

XmNscreen

Class: XmCScreen
Default: dynamic
Type:  Screen ∗
Access: CG

XmNsensitive

Class: XmCSensitive
Default: True
Type:  Boolean
Access: CSG

XmNtranslations

Class: XmCTranslations
Default: dynamic
Type:  XtTranslations
Access: CSG

XmNwidth

Class: XmCWidth
Default: dynamic
Type:  Dimension
Access: CSG

XmNx

Class: XmCPosition
Default: 0
Type:  Position
Access: CSG

XmNy

Class: XmCPosition
Default: 0
Type:  Position
Access: CSG

Callback Information

A pointer to the following structure is passed to each callback:

typedef struct
{
  int      reason;
  XEvent   ∗ event;
  Window   window;
} XmDrawingAreaCallbackStruct;

reason
Indicates why the callback was invoked

event
Points to the XEvent that triggered the callback. This is NULL for the XmNresizeCallback. 

window
Is set to the widget window

Translations

XmDrawingArea inherits translations from XmManager. Before calling the XmManager actions, all events in the inherited translations except <BtnMotion>, <EnterWindow>, <LeaveWindow>, <FocusIn>, and <FocusOut> also call the DrawingAreaInput() action. 

XmDrawingArea has the additional translations listed below. These translations may not directly correspond to a translation table. 

MAny BAny Press:DrawingAreaInput()
MAny BAny Release:DrawingAreaInput()
MAny KAny Press:DrawingAreaInput()
               ManagerGadgetKeyInput()
MAny KAny Release:DrawingAreaInput()

Action Routines

The XmDrawingArea action routines are described below:

DrawingAreaInput():
Unless the event takes place in a gadget, calls the callbacks for XmNinputCallback. 

ManagerGadgetKeyInput():
Causes the current gadget to process a keyboard event.

Additional Behavior

The XmDrawingArea widget has the additional behavior described below:

<Expose>:
Calls the callbacks for XmNexposeCallback. 

<Widget Resize>:
Calls the callbacks for XmNresizeCallback. 

Virtual Bindings

The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see VirtualBindings(3X). 

SEE ALSO

Composite(3X), Constraint(3X), Core(3X), XmCreateDrawingArea(3X), XmManager(3X)

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