'\" t .\" ScrollA.sgm /main/11 1996/09/08 21:00:23 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmScrolledWindow" 3 .SH "NAME" \fBXmScrolledWindow\fP \(em The ScrolledWindow widget class "XmScrolledWindow" "widget class" "ScrolledWindow" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP The ScrolledWindow widget combines one or two ScrollBar widgets and a viewing area to implement a visible window onto some other (usually larger) data display\&. The visible part of the window can be scrolled through the larger display by the use of ScrollBars\&. .PP To use ScrolledWindow, an application first creates a ScrolledWindow widget, any needed ScrollBar widgets, and a widget capable of displaying any desired data as the work area of ScrolledWindow\&. ScrolledWindow positions the work area widget and displays the ScrollBars if so requested\&. When the user performs some action on the ScrollBar, the application is notified through the normal ScrollBar callback interface\&. .PP ScrolledWindow can be configured to operate automatically so that it performs all scrolling and display actions with no need for application program involvement\&. It can also be configured to provide a minimal support framework in which the application is responsible for processing all user input and making all visual changes to the displayed data in response to that input\&. .PP When ScrolledWindow is performing automatic scrolling it creates a clipping window and automatically creates the scroll bars\&. Conceptually, this window becomes the viewport through which the user examines the larger underlying data area\&. The application simply creates the desired data, then makes that data the work area of the ScrolledWindow\&. When the user moves the slider to change the displayed data, the workspace is moved under the viewing area so that a new portion of the data becomes visible\&. .PP Sometimes it is impractical for an application to create a large data space and simply display it through a small clipping window\&. For example, in a text editor, creating a single data area that consisted of a large file would involve an undesirable amount of overhead\&. The application needs to use a ScrolledWindow (a small viewport onto some larger data), but needs to be notified when the user scrolls the viewport so it can bring in more data from storage and update the display area\&. For these cases, the ScrolledWindow can be configured so that it provides only visual layout support\&. No clipping window is created, and the application must maintain the data displayed in the work area, as well as respond to user input on the ScrollBars\&. .PP The user can specify resources in a resource file for the automatically created widgets that contain the horizontal and vertical scrollbars and the clipping area of the ScrolledWindow widget\&. The names of these widgets are \fBHorScrollBar\fP, \fBVertScrollBar\fP, and \fBClipWindow\fP respectively, and remain consistent whether created by \fBXmCreateScrolledList\fP, \fBXmCreateScrolledText\fP or \fBXmCreateScrolledWindow\fP\&. .PP ScrolledWindow uses the \fBXmQTnavigator\fP trait, and holds the \fBXmQTscrollFrame\fP trait\&. .SS "Descendants" .PP ScrolledWindow automatically creates the descendants shown in the following table\&. An application can use \fBXtNameToWidget\fP to gain access to the named descendant\&. In addition, a user or an application can use the named descendant when specifying resource values\&. .TS tab() box; l| l| l. \fBNamed Descendant\fP\fBClass\fP\fBIdentity\fP ___ = ___ \fBVertScrollBar\fP\fBXmScrollBar\fPvertical scroll bar ___ \fBHorScrollBar\fP\fBXmScrollBar\fPhorizontal scroll bar ___ \fBClipWindow\fP\fBXmClipWindow\fPclip window ___ .TE .SS "Classes" .PP ScrolledWindow inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, and \fBXmManager\fP\&. .PP The class pointer is \fBxmScrolledWindowWidgetClass\fP\&. .PP The class name is \fBXmScrolledWindow\fP\&. .SS "New Resources" .PP 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 \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, 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 \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmScrolledWindow Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNautoDragModelXmCAutoDragModelXtEnumXmAUTO_DRAG_ENABLEDCSG _____ XmNclipWindowXmCClipWindowWidgetdynamicG _____ XmNhorizontalScrollBarXmCHorizontalScrollBarWidgetdynamicCSG _____ XmNscrollBarDisplayPolicyXmCScrollBarDisplayPolicyunsigned chardynamicCSG _____ XmNscrollBarPlacementXmCScrollBarPlacementunsigned charXmBOTTOM_RIGHTCSG _____ XmNscrolledWindowMarginHeightXmCScrolledWindowMarginHeightDimension0CSG _____ XmNscrolledWindowMarginWidthXmCScrolledWindowMarginWidthDimension0CSG _____ XmNscrollingPolicyXmCScrollingPolicyunsigned charXmAPPLICATION_DEFINEDCG _____ XmNspacingXmCSpacingDimension4CSG _____ XmNtraverseObscuredCallbackXmCCallbackXtCallbackListNULLCSG _____ XmNverticalScrollBarXmCVerticalScrollBarWidgetdynamicCSG _____ XmNvisualPolicyXmCVisualPolicyunsigned chardynamicG _____ XmNworkWindowXmCWorkWindowWidgetNULLCSG _____ .TE .IP "\fBXmNautoDragModel\fP" 10 Indicates whether automatic drag is enabled (\fBXmAUTO_DRAG_ENABLED\fP or disabled (\fBXmAUTO_DRAG_DISABLED\fP)\&. By default it is enabled\&. .IP "\fBXmNclipWindow\fP" 10 Specifies the widget ID of the clipping area\&. This is automatically created by ScrolledWindow when the \fBXmNvisualPolicy\fP resource is set to \fBXmCONSTANT\fP and can only be read by the application\&. Any attempt to set this resource to a new value causes a warning message to be printed by the scrolled window\&. If the \fBXmNvisualPolicy\fP resource is set to \fBXmVARIABLE\fP, this resource is set to NULL, and no clipping window is created\&. .IP "\fBXmNhorizontalScrollBar\fP" 10 Specifies the widget ID of the horizontal ScrollBar\&. This is automatically created by ScrolledWindow when the \fBXmNscrollingPolicy\fP is initialized to \fBXmAUTOMATIC\fP; otherwise, the default is NULL\&. .IP "\fBXmNscrollBarDisplayPolicy\fP" 10 Controls the automatic placement of the ScrollBars\&. If it is set to \fBXmAS_NEEDED\fP and if \fBXmNscrollingPolicy\fP is set to \fBXmAUTOMATIC\fP, ScrollBars are displayed only if the workspace exceeds the clip area in one or both dimensions\&. A resource value of \fBXmSTATIC\fP causes the ScrolledWindow to display the ScrollBars whenever they are managed, regardless of the relationship between the clip window and the work area\&. This resource must be \fBXmSTATIC\fP when \fBXmNscrollingPolicy\fP is \fBXmAPPLICATION_DEFINED\fP\&. The default is \fBXmAS_NEEDED\fP when \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, and \fBXmSTATIC\fP otherwise\&. .IP "\fBXmNscrollBarPlacement\fP" 10 Specifies the positioning of the ScrollBars in relation to the work window\&. The values are .RS .IP "\fBXmTOP_LEFT\fP" 10 The horizontal ScrollBar is placed above the work window; the vertical ScrollBar to is placed the left\&. .IP "\fBXmBOTTOM_LEFT\fP" 10 The horizontal ScrollBar is placed below the work window; the vertical ScrollBar to is placed the left\&. .IP "\fBXmTOP_RIGHT\fP" 10 The horizontal ScrollBar is placed above the work window; the vertical ScrollBar to is placed the right\&. .IP "\fBXmBOTTOM_RIGHT\fP" 10 The horizontal ScrollBar is placed below the work window; the vertical ScrollBar to is placed the right\&. .RE .IP "" 10 The default value depends on the value of the \fBXmNlayoutDirection\fP resource of the widget\&. .IP "\fBXmNscrolledWindowMarginHeight\fP" 10 Specifies the margin height on the top and bottom of the ScrolledWindow\&. In order to use the autoscroll drag feature of the Motif drag and drop facility, a user must be able to hold a drag icon over the margin of a scrolled window\&. Though drag and drop will work with the default margin size of zero, a user may find it difficult to position the icon precisely enough to use the feature easily\&. The application programmer should ensure that the window margins are set to an adequate size, if the use of the autoscroll drag feature is desired\&. .IP "\fBXmNscrolledWindowMarginWidth\fP" 10 Specifies the margin width on the right and left sides of the ScrolledWindow\&. Please refer to the warning concerning the default margin size for the \fBXmNscrolledWindowMarginHeight\fP resource, above\&. .IP "\fBXmNscrollingPolicy\fP" 10 Performs automatic scrolling of the work area with no application interaction\&. If the value of this resource is \fBXmAUTOMATIC\fP, ScrolledWindow automatically creates the ScrollBars; attaches callbacks to the ScrollBars; sets the visual policy to \fBXmCONSTANT\fP; and automatically moves the work area through the clip window in response to any user interaction with the ScrollBars\&. An application can also add its own callbacks to the ScrollBars\&. This allows the application to be notified of a scroll event without having to perform any layout procedures\&. .IP "" 10 \fBNOTE\fP: Since the ScrolledWindow adds callbacks to the ScrollBars, an application should not perform an \fBXtRemoveAllCallbacks\fP on any of the ScrollBar widgets\&. .IP "" 10 When \fBXmNscrollingPolicy\fP is set to \fBXmAPPLICATION_DEFINED\fP, the application is responsible for all aspects of scrolling\&. The ScrollBars must be created by the application, and it is responsible for performing any visual changes in the work area in response to user input\&. .IP "" 10 This resource must be set to the desired policy at the time the ScrolledWindow is created\&. It cannot be changed through \fBSetValues\fP\&. .IP "\fBXmNspacing\fP" 10 Specifies the distance that separates the ScrollBars from the work window\&. .IP "\fBXmNtraverseObscuredCallback\fP" 10 Specifies a list of callbacks that is called when traversing to a widget or gadget that is obscured due to its position in the work area relative to the location of the ScrolledWindow viewport\&. This resource is valid only when \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP\&. If this resource is NULL, an obscured widget cannot be traversed to\&. The callback reason is \fBXmCR_OBSCURED_TRAVERSAL\fP\&. .IP "\fBXmNverticalScrollBar\fP" 10 Specifies the widget ID of the vertical ScrollBar\&. This is automatically created by ScrolledWindow when the \fBXmNscrollingPolicy\fP is initialized to \fBXmAUTOMATIC\fP; otherwise, the default is NULL\&. .IP "\fBXmNvisualPolicy\fP" 10 Enlarges the ScrolledWindow to match the size of the work area\&. It can also be used as a static viewport onto a larger data space\&. If the visual policy is \fBXmVARIABLE\fP, the ScrolledWindow forces the ScrollBar display policy to \fBXmSTATIC\fP and allows the work area to grow or shrink at any time and adjusts its layout to accommodate the new size\&. When the policy is \fBXmCONSTANT\fP, the work area grows or shrinks as requested, but a clipping window forces the size of the visible portion to remain constant\&. The only time the viewing area can grow is in response to a resize from the ScrolledWindow\&'s parent\&. The default is \fBXmCONSTANT\fP when \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, and \fBXmVARIABLE\fP otherwise\&. .IP "" 10 \fBNOTE\fP: This resource must be set to the desired policy at the time the ScrolledWindow is created\&. It cannot be changed through \fBSetValues\fP\&. .IP "\fBXmNworkWindow\fP" 10 Specifies the widget ID of the viewing area\&. .TS tab() box; c s s s s l| l| l| l| l. T{ \fBXmScrolledWindow Constraint Resource Set\fP T} \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNscrolledWindowChildTypeXmCScrolledWindowChildTypeunsigned charRESOURCE_DEFAULTCSG _____ .TE .IP "\fBXmNscrolledWindowChildType\fP" 10 Specifies what the child is\&. ScrolledWindow supports a number of child types\&. The possible values are: .RS .IP "\fBXmWORK_AREA\fP" 10 Indicates a work area child\&. This specifies that both ScrollBars are limited to moving the child inside the clipping window\&. If the scrolling policy is \fBXmAUTOMATIC\fP, the work area child can move in both directions\&. .IP "\fBXmHOR_SCROLLBAR\fP" 10 Indicates a horizontal child widget; the child must have the \fBXmQTnavigator\fP trait installed\&. For example, the \fBXmScrollBar\fP widget has the \fBXmQTnavigator\fP trait installed\&. .IP "\fBXmVERT_SCROLLBAR\fP" 10 Indicates a vertical child widget; the child must have the \fBXmQTnavigator\fP trait installed\&. .IP "\fBXmSCROLL_HOR\fP" 10 Indicates that only the horizontal ScrollBar moves the child\&. This value is only meaningful if the scrolling policy is \fBXmAUTOMATIC\fP\&. .IP "\fBXmSCROLL_VERT\fP" 10 Indicates that only the vertical ScrollBar moves the child\&. This value is only meaningful if the scrolling policy is \fBXmAUTOMATIC\fP\&. .IP "\fBXmNO_SCROLL\fP" 10 Indicates that the child does not move with the ScrollBars\&. This value is only meaningful if the scrolling policy is \fBXmAUTOMATIC\fP\&. .RE .SS "Inherited Resources" .PP ScrolledWindow inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetNULLCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP The application must use the ScrollBar callbacks to be notified of user input\&. .PP ScrolledWindow defines a callback structure for use with \fBXmNtraverseObscuredCallback\fP callbacks\&. The \fBXmNtraverseObscuredCallback\fP resource provides a mechanism for traversal to obscured widgets (or gadgets) due to their position in the work area of a ScrolledWindow\&. The \fBXmNtraverseObscuredCallback\fP routine has responsibility for adjusting the position of the work area such that the specified traversal destination widget is positioned within the viewport of the ScrolledWindow\&. A NULL \fBXmNtraverseObscuredCallback\fP resource causes obscured widgets within the ScrolledWindow to be nontraversable\&. .PP Traversal to an obscured widget or gadget requires these conditions to be met: the widget or gadget can be obscured only due to its position in the work area of a ScrolledWindow relative to the viewport; the viewport of the associated ScrolledWindow is fully visible, or can be made so by virtue of ancestral \fBXmNtraverseObscuredCallback\fP routines; and the \fBXmNtraverseObscuredCallback\fP resource must be non-NULL\&. .PP When ScrolledWindow widgets are nested, the \fBXmNtraverseObscuredCallback\fP routine for each ScrolledWindow that obscures the traversal destination is called in ascending order within the given hierarchy\&. .PP A pointer to the following structure is passed to callbacks for \fBXmNtraverseObscuredCallback\fP\&. .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP: Widget \fItraversal_destination\fP; XmTraversalDirection \fIdirection\fP; } XmTraverseObscuredCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .IP "\fItraversal_destination\fP" 10 Specifies the widget or gadget to traverse to, which will be a descendant of the work window\&. .IP "\fIdirection\fP" 10 Specifies the direction of traversal\&. See the description of the \fIdirection\fP parameter in the \fBXmProcessTraversal\fP reference page for an explanation of the valid values\&. .SS "Translations" .PP \fBXmScrolledWindow\fP includes the translations from \fBXmManager\fP\&. .SS "Additional Behavior" .PP This widget has the following additional behavior: .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window up the height of the viewport\&. The distance scrolled may be reduced to provide some overlap\&. The actual distance scrolled depends on the \fBXmNpageIncrement\fP resource of the vertical ScrollBar\&. .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window down the height of the viewport\&. The distance scrolled may be reduced to provide some overlap\&. The actual distance scrolled depends on the \fBXmNpageIncrement\fP resource of the vertical ScrollBar\&. .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window left the width of the viewport\&. The distance scrolled may be reduced to provide some overlap\&. The actual distance scrolled depends on the \fBXmNpageIncrement\fP resource of the horizontal ScrollBar\&. .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window right the width of the viewport\&. The distance scrolled may be reduced to provide some overlap\&. The actual distance scrolled depends on the \fBXmNpageIncrement\fP resource of the horizontal ScrollBar\&. .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window horizontally to the edge corresponding to the horizontal ScrollBar\&'s minimum value\&. .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window horizontally to the edge corresponding to the horizontal ScrollBar\&'s maximum value\&. .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window vertically to the edge corresponding to the vertical ScrollBar\&'s minimum value\&. .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window vertically to the edge corresponding to the vertical ScrollBar\&'s maximum value\&. .PP Certain applications will want to replace the page bindings with ones that are specific to the content of the scrolled area\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateScrolledWindow\fP(3), \fBXmManager\fP(3), \fBXmProcessTraversal\fP(3), \fBXmScrollBar\fP(3), \fBXmScrollVisible\fP(3), \fBXmScrolledWindowSetAreas\fP(3), \fBXmVaCreateScrolledWindow\fP(3), and \fBXmVaCreateManagedScrolledWindow\fP(3)\&.