http://invisible-island.net/athena_widgets/XawPlus

_________________________________________________________XawPlus

The Viewport Widget

Application Header file
Class Header file
Class
Class Name
Superclass
<X11/XawPlus/Viewport.h>
<X11/XawPlus/ViewportP.h>
viewportWidgetClass
Viewport
Form

The Viewport widget consists of a frame window, one or two Scrollbars, and an inner window. The size of the frame window is determined by the viewing size of the data that is to be displayed and the dimensions to which the Viewport is created. The inner window is the full size of the data that is to be displayed and is clipped by the frame window. The Viewport widget controls the scrolling of the data directly. No application callbacks are required for scrolling.

When the geometry of the frame window is equal in size to the inner window, or when the data does not require scrolling, the Viewport widget automatically removes any scrollbars. The forceBars option causes the Viewport widget to display all scrollbars permanently.

Differences between Xaw and XawPlus

Since XawPlus release 1.4 the scrollbars are placed at bottom and right side of the window. The default values of the resources useBottom and useRight changes from False to True.

Resources

When creating a Viewport widget instance, the following resources are retrieved from the argument list of XtSetValues() or XtVaSetValues() or from the resource database:

Name Class Type Default Value
OBJECT:
destroyCallback Callback Pointer NULL
RECTANGLE:
borderWidth
height
sensitive
width
x
y
BorderWidth
Height
Sensitive
Width
Position
Position
Dimension
Dimension
Boolean
Dimension
Position
Position
1
Space for all children
True
Space for all children
0
0
CORE:
border
background
mappedWhenManaged
BorderColor
Background
MappedWhenManaged
Pixel
Pixel
Boolean
XtDefaultForeground
grey75
True
FORM:
defaultDistance Thickness int 4
VIEWPORT:
allowHoriz
allowVert
foreceBars
reportCallback
useBottom
useRight
Boolean
Boolean
Boolean
ReportCallback
Boolean
Boolean
Boolean
Boolean
Boolean
Pointer
Boolean
Boolean
False
False
False
NULL
True
True
allowHoriz
allowVert
If these resources are False then the Viewport will never create a scrollbar in this direction. If it is True then the scrollbar will only appear when it is needed, unless forceBars is True.
forceBars When this resource ist set to True, the scrollbars that have been allowed will always be visible on the screen. If False the scrollbars will be visible only when the inner window is larger than the frame.
reportCallback These callbacks will be executed whenever the Viewport adjusts the viewed area of the child. The call_data parameter is a pointer to an XawPannerReport structure.
useBottom
useRight
By default the scrollbars appear on the right and bottom of the screen. These resources allow the vertical scrollbar to be placed on the left edge of the Viewport, and the horizontal scrollbar on the top edge of the Viewport.

Layout Semantics

The Viewport widget manages a single child widget. When the size of the child is larger than the size of the Viewport, the user can interactively move the child within the Viewport by repositioning the scrollbars.

The default size of the Viewport before it is realized is the width and/or height of the child. After it is realized, the Viewport will allow its child to grow vertically or horizontally if allowVert or allowHoriz are set, respectively. If the corresponding vertical or horizontal scrollbar is not enabled, the Viewport will propagate the geometry request to its own parent and the child will be allowed to change size only if the Viewport's parent allows it. Regardless of whether or not scrollbars are enabled in the corresponding direction, if the child requests a new size smaller than the Viewport size, the change will be allowed only if the parent of the Viewport allows the Viewport to shrink to the appropriate dimension.

The scrollbar children of the Viewport are named horizontal and vertical. By using these names the programmer can specify resources for the individual scrollbars. XtSetValues() can be used to modify the resources dynamically once the widget ID has been obtained with XtNameToWidget().

Although the Viewport is a Subclass of the Form, no resources for the Form may be supplied for any of the children of the Viewport. These constraints are managed internally, and are not meant for public consumption.

XawPlus_________________________________________________________