NAME
Porthole widget − a panable view of a larger child widget.
SYNOPSIS
Public Headers:<X11/StringDefs.h> <X11/Xaw/Porthole.h>
Private Header:<X11/Xaw/PortholeP.h>
Class Name:Porthole
Class Pointer:portholeWidgetClass
Instantiation:widget = XtCreateWidget(name, portholeWidgetClass, ...)
CLASS HIERARCHY
Core → Composite → Porthole
AVAILABILITY
Release 5 and later.
DESCRIPTION
The Porthole widget provides geometry management of a list of arbitrary widgets, only one of which may be managed at any particular time. The managed child widget is reparented within the porthole and is moved around by the application (typically under the control of a Panner widget). The Porthole widget allows its managed child to request any size that is as large or larger than the Porthole itself and any location so long as the child still obscures all of the Porthole.
RESOURCES
When creating a Porthole widget instance, the following resources are retrieved from the argument list or from the resource database:
| Name | Type | Default | Description | |||
| XtNaccelerators | AcceleratorTable | NULL | Accelerators for this widget. | |||
| XtNancestor− Sensitive |
Boolean | True | Sensitivity state of the ancestors of this widget. | |||
| XtNbackground | Pixel | XtDefault− Background |
Window background color. | |||
| XtNbackground− Pixmap |
Pixmap | XtUnspecified− Pixmap |
Window background pixmap. | |||
| XtNborderColor | Pixel | XtDefault− Foreground |
Window border color. | |||
| XtNborderPixmap | Pixmap | XtUnspecified− Pixmap |
Window border pixmap. | |||
| XtNborderWidth | Dimension | 1 | Border width on button porthole. | |||
| XtNchildren | WidgetList | NULL | List of all this composite widget’s current children. | |||
| XtNcolormap | Colormap | Parent’s colormap. | Colormap that this widget will use. | |||
| XtNdepth | int | Parent’s depth. | Depth of this widget’s window. | |||
| XtNdestroy− Callback |
XtCallbackList | NULL | Callbacks for XtDestroyWidget | |||
| XtNheight | Dimension | See below. | Viewing height of inner window. | |||
| XtNmappedWhen− Managed |
Boolean | TRUE | Whether XtMapWidget is automatic. | |||
| XtNnumChildren | Cardinal | 0 | Number of children in this composite widget. | |||
| XtNreportCallback | XtCallbackList | NULL | Called when child moves or resizes. | |||
| XtNscreen | Screen | Parent’s screen. | Screen on which this widget is displayed. | |||
| XtNsensitive | Boolean | TRUE | Whether widget receives input. | |||
| XtNtranslations | TranslationTable | NULL | Event-to-action translations. | |||
| XtNwidth | Dimension | See below. | Viewing width of inner window. | |||
| XtNx | Position | 0 | x-coordinate in pixels. | |||
| XtNy | Position | 0 | y-coordinate in pixels. | |||
There is only one new resource (not inherited from a superclass) associated with the Panner widget:
XtNreportCallback
A list of functions to invoke whenever the managed child widget changes size or position. The call_data argument is of type XawPannerReport ∗, shown below.
CALLBACK STRUCTURES
The functions registered on the XtNreportCallback list are invoked with a call_data argument which is a pointer to a structure of type XawPannerReport: /∗
∗ XawPannerReport - this structure is used by the reportCallback of the
∗ Panner, Porthole, Viewport, and Scrollbar widgets to report its
∗ position. All fields must be filled in, although the changed field
∗ may be used as a hint as to which fields have been altered since the
∗ last report.
∗/ typedef struct {
unsigned int changed;/∗ mask, see below ∗/
Position slider_x, slider_y;/∗ location of slider within outer ∗/
Dimension slider_width, slider_height; /∗ size of slider ∗/
Dimension canvas_width, canvas_height; /∗ size of canvas ∗/ } XawPannerReport;
#define XawPRSliderX(1 << 0) #define XawPRSliderY(1 << 1) #define XawPRSliderWidth (1 << 2) #define XawPRSliderHeight (1 << 3) #define XawPRCanvasWidth (1 << 4) #define XawPRCanvasHeight (1 << 5) #define XawPRAll (63) /∗ union of above ∗/
PUBLIC FUNCTIONS
No public functions defined.
SEE ALSO
Composite, Panner.