Viewport widget


Application Header file <Xraw/Dialog.h>
Class Header file <Xraw/DialogP.h>
Class dialogWidgetClass
Class Name Dialog
Superclass Form --> Container --> Constraint --> Composit --> Core

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.


New Resources

Name Class Type Notes Default Value
allowHoriz Boolean Boolean False
allowVert Boolean Boolean False
forceBars Boolean Boolean False
reportCallback ReportCallback XtCallbackList NULL
useBottom Boolean Boolean False
useRight Boolean Boolean False
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 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 left and top of the screen. These resources allow the vertical scrollbar to be placed on the right edge of the Viewport, and the horizontal scrollbar on the bottom 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.

Note

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

[Xraw home] [Xraw widget class hierarchy]


Vladimir T. Romanovski
romsky@hp1.oea.ihep.su