NAME
Grip widget − attachment point for dragging other widgets.
SYNOPSIS
Public Headers:<X11/StringDefs.h> <X11/Xaw/Grip.h>
Private Header:<X11/Xaw/GripP.h>
Class Name:Grip
Class Pointer:gripWidgetClass
Instantiation:widget = XtCreateWidget(name, gripWidgetClass, ...)
CLASS HIERARCHY
Core → Simple → Grip
DESCRIPTION
The Grip widget provides a small region in which user input events (such as ButtonPress or ButtonRelease) may be handled. The most common use for the Grip widget is as an attachment point for visually repositioning an object, such as the pane border in a Paned widget.
RESOURCES
When creating a Grip widget instance, the following resources are retrieved from the argument list or from the resource database:
| Name (XtN...) | Type | Default | Description | |||
| XtNaccelerators | AcceleratorTable | NULL | List of event-to-action bindings to be executed by this widget, even though the event occurred in another widget. | |||
| XtNancestorSensitive | Boolean | True | (D) Sensitivity state of the ancestors of this widget: a widget is insensitive if either it or any of its ancestors is insensitive. | |||
| XtNbackground | Pixel | XtDefault− Background |
Window background color. | |||
| XtNbackgroundPixmap | Pixmap | XtUnspecified− Pixmap |
Window background pixmap. | |||
| XtNborderColor | Pixel | XtDefault− Foreground |
Window border color. | |||
| XtNborderPixmap | Pixmap | XtUnspecified− Pixmap |
Window border pixmap. | |||
| XtNborderWidth | Dimension | 0 | Width of the border in pixels. | |||
| XtNcallback | XtCallbackList | NULL | Action routine. | |||
| XtNcolormap | Colormap | Parent’s colormap. | Colormap that this widget will use. | |||
| XtNcursor | Cursor | None | Cursor for the grip. | |||
| XtNdepth | int | Parent’s depth. | (C) Depth of this widget’s window. | |||
| XtNdestroyCallback | XtCallbackList | NULL | Callback for XtDestroyWidget(). | |||
| XtNforeground | Pixel | XtDefault− Foreground |
Window background color. | |||
| XtNheight | Dimension | 8 | Height of the widget. | |||
| XtNinsensitiveBorder | Pixmap | Gray pixmap | Pixmap will be tiled into the widget’s border if the widget becomes insensitive. | |||
| XtNmappedWhenManaged | Boolean | TRUE | Whether XtMapWidget() is automatic. | |||
| XtNscreen | Screen | Parent’s screen. | (R) Screen on which this widget is displayed. | |||
| XtNsensitive | Boolean | TRUE | Whether widget should receive input. | |||
| XtNtranslations | TranslationTable | NULL | Event-to-action translations. | |||
| XtNwidth | Dimension | 8 | Width of the widget. | |||
| XtNx | Position | 0 | x coordinate in pixels. | |||
| XtNy | Position | 0 | y coordinate in pixels. | |||
Note that the Grip widget displays its region with the foreground pixel only.
TRANSLATIONS AND ACTIONS
The Grip widget does not declare any default event translation bindings, but it does declare a single action routine named GripAction in its action table. The client specifies an arbitrary event translation table, giving parameters to the GripAction routine.
The GripAction action executes the callbacks on the XtNcallback list, passing as call_data a pointer to a XawGripCallData structure, defined in <X11/Xaw/Grip.h>:
typedef struct _GripCallData { XEvent ∗event; String ∗params; Cardinal num_params; } XawGripCallDataRec, ∗XawGripCallData, GripCallDataRec, ∗GripCallData; /∗ for R4 compatibility ∗/
In this structure, event is a pointer to the input event that triggered the action, and params and num_params give the string parameters specified in the translation table for the particular event binding.
The following is an example of a GripAction translation table: <Btn1Down>:GripAction(press) <Btn1Motion>: GripAction(move) <Btn1Up>: GripAction(release)
SEE ALSO
Paned.