Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XmDrawiAr(Xm) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought


 XmDrawingArea(Xm)              6 January 1993              XmDrawingArea(Xm)


 Name

    XmDrawingArea - the DrawingArea widget class

 Syntax


    #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 pro-
    grammer 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

 ____________________________________________________________________________
 Name               Class               Type            Default        Access
 ____________________________________________________________________________
 XmNexposeCallback  XmCCallback         XtCallbackList  NULL           C
 XmNinputCallback   XmCCallback         XtCallbackList  NULL           C
 XmNmarginHeight    XmCMarginHeight     Dimension       10             CSG
 XmNmarginWidth     XmCMarginWidth      Dimension       10             CSG
 XmNresizeCallback  XmCCallback         XtCallbackList  NULL           C
 XmNresizePolicy    XmCResizePolicy     unsigned char   XmRESIZE_ANY   CSG


    XmNexposeCallback
            Specifies the list of callbacks that is called when DrawingArea
            receives an exposure event. The callback reason is XmCREXPOSE.
            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 XmCRINPUT. The callback struc-
            ture 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 XmCRRESIZE.

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

    Inherited resources

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

 XmManager resource set

 ____________________________________________________________________________
 Name              Class              Type             Default         Access
 ____________________________________________________________________________
 XmNbottomShadow-  XmCBottomShadow-   Pixel            dynamic         CSG
 Color             Color
 XmNbottomShadow-  XmCBottomShadow-   Pixmap           XmUNSPECIFIED_- CSG
 Pixmap            Pixmap                              PIXMAP
 XmNforeground     XmCForeground      Pixel            dynamic         CSG
 XmNhelpCallback   XmCCallback        XtCallbackList   NULL            C
 XmNhighlightColor XmCHighlightColor  Pixel            dynamic         CSG
 XmNhighlightPixmapXmCHighlightPixmap Pixmap           dynamic         CSG
 XmNinitialFocus   XmCInitialFocus    Widget           NULL            CSG
 XmNnavigationType XmCNavigationType  XmNavigationType XmTAB_GROUP     CSG
 XmNshadowThicknessXmCShadowThickness Dimension        0               CSG
 XmNstringDirectionXmCStringDirection XmStringDirectiondynamic         CG
 XmNtopShadowColor XmCTopShadowColor  Pixel            dynamic         CSG
 XmNtopShadowPixmapXmCTopShadowPixmap Pixmap           dynamic         CSG
 XmNtraversalOn    XmCTraversalOn     Boolean          True            CSG
 XmNunitType       XmCUnitType        unsigned char    dynamic         CSG
 XmNuserData       XmCUserData        XtPointer        NULL            CSG


 Composite resource set

 ____________________________________________________________________________
 Name                 Class                Type           Default      Access
 ____________________________________________________________________________
 XmNchildren          XmCReadOnly          WidgetList     NULL         G
 XmNinsertPosition    XmCInsertPosition    XtOrderProc    NULL         CSG
 XmNnumChildren       XmCReadOnly          Cardinal       0            G


 Core resource set

 ____________________________________________________________________________
 Name              Class             Type          Default             Access
 ____________________________________________________________________________
 XmNaccelerators   XmCAccelerators   XtAcceleratorsdynamic             CSG
 XmNancestor-      XmCSensitive      Boolean       dynamic             G
 Sensitive
 XmNbackground     XmCBackground     Pixel         dynamic             CSG
 XmNbackground-    XmCPixmap         Pixmap        XmUNSPECIFIED_-     CSG
 Pixmap                                            PIXMAP
 XmNborderColor    XmCBorderColor    Pixel         XtDefaultForeground CSG
 XmNborderPixmap   XmCPixmap         Pixmap        XmUNSPECIFIED_-     CSG
                                                   PIXMAP
 XmNborderWidth    XmCBorderWidth    Dimension     0                   CSG
 XmNcolormap       XmCColormap       Colormap      dynamic             CG
 XmNdepth          XmCDepth          int           dynamic             CG
 XmNdestroyCallbackXmCCallback       XtCallbackListNULL                C
 XmNheight         XmCHeight         Dimension     dynamic             CSG
 XmNinitial-       XmCInitial-       Boolean       True                C
 Resources-        Resources-
 Persistent        Persistent
 XmNmappedWhen-    XmCMappedWhen-    Boolean       True                CSG
 Managed           Managed
 XmNscreen         XmCScreen         Screen *      dynamic             CG
 XmNsensitive      XmCSensitive      Boolean       True                CSG
 XmNtranslations   XmCTranslations   XtTranslationsdynamic             CSG
 XmNwidth          XmCWidth          Dimension     dynamic             CSG
 XmNx              XmCPosition       Position      0                   CSG
 XmNy              XmCPosition       Position      0                   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 trans-
    lations 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(Xm).

 See also

    Composite(Xm), Constraint(Xm), Core(Xm), XmCreateDrawingArea(Xm) and
    XmManager(Xm).


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