XmGadget(3Xm)

NAME
XmGadget — the Gadget widget class.

SYNOPSIS
#include <Xm/Xm.h>

DESCRIPTION
Gadget is a widget class used as a supporting superclass for other gadget classes. It handles shadow border drawing and highlighting, traversal activation and deactivation, and various callback lists needed by gadgets.

The color and pixmap resources defined by XmManager are directly used by gadgets. If XtSetValues is used to change one of the resources for a manager widget, then all of the gadget children within the manager also change.

  Classes
Gadget inherits behavior and resources from Object and RectObj classes.

    The class pointer is xmGadgetClass.

    The class name is XmGadget.

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

XmGadget Resource Set
Name | Class | Type | Default | Access
XmNhelpCallback | XmCCallback | XtCallbackList | NULL | C
XmNhighlightOnEnter | XmCHighlightOnEnter | Boolean | False | CSG
XmNhighlightThickness | XmCHighlightThickness | short | 0 | CSG
XmNshadowThickness | XmCShadowThickness | short | 2 | CSG
XmNtraversalOn | XmCTraversalOn | Boolean | False | CSG
XmNunitType | XmCUnitType | unsigned char | XmPIXELS | CSG
XmNuserData | XmCUserData | caddr_t | NULL | CSG

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.

XmNhighlightOnEnter
    Specifies whether or not to draw border highlighting. This resource is ignored if XmNtraversalOn is True.

XmNhighlightThickness
    Specifies the thickness of the highlighting rectangle.

XmNshadowThickness
    Specifies the size of the drawn border shadow.

XmNtraversalOn
    Specifies traversal activation for this gadget.

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 gadget. An internally unused resource.

  Inherited Resources
Gadget inherits the following resources from the named superclass. For a complete description of these resources, refer to the man page for that superclass.

RectObj Resource Set
Name | Class | Type | Default | Access
XmNancestorSensitive | XmCSensitive | Boolean | XtCopyFromParent | CSG
XmNborderWidth | XmCBorderWidth | Dimension | 0 | CSG
XmNheight | XmCHeight | Dimension | 0 | CSG
XmNsensitive | XmCSensitive | Boolean | True | CSG
XmNwidth | XmCWidth | Dimension | 0 | CSG
XmNx | XmCPosition | Position | 0 | CSG
XmNy | XmCPosition | Position | 0 | CSG

Object Resource Set
Name | Class | Type | Default | Access
XmNdestroyCallback | XmCCallback | XtCallbackList | NULL | C

  Behavior
Gadgets cannot have translations associated with them. Because of this, a Gadget's behavior is determined by the Manager widget into which the Gadget is placed. The following are types of events which are caught by a Manager widget and forwarded to a Gadget:

•   ButtonPress

•   ButtonRelease

•   EnterNotify

•   LeaveNotify

•   FocusIn

•   FocusOut

•   MotionNotify

    Refer to XmManager(3Xm) for a discussion of the translations supported by all Manager widgets.

RELATED INFORMATION
Object(3Xm), RectObj(3Xm), and XmManager(3Xm).