Generic Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version

## scroll-increment

Arguments: window type direction

This generic function is called to determine the amount by which a regular (non-widget) window should be scrolled when the user clicks on the window's scrollbars. The function should return the amount by which the window should scroll (measured in pixels). This function affects when the user clicks on the arrows or body of the scrollbars, but not when they drag the scroller box.

This function is a platform-independent partial alternative to the older function user-scroll, which is called on Windows but not on GTK. Methods supplied by an application should not make assumptions about when the methods will be called, though, because this happens at different times on different platforms. Specifically, on Windows the function is called when the user clicks on the scrollbar, whereas on GTK it is called when the user creates or resizes the window or changes its page size.

window is the window being scrolled.

type is either `:line` (if the user has clicked on a scrollbar arrow) or `:page` (if the user has clicked in the scrollbar body).

direction is either :vertical (if the user has clicked on a vertical scrollbar) or `:horizontal` (for a horizontal scrollbar).

Here are the default methods. They cause line scrolling to scroll by one text line, and page scrolling to scroll by one text line less than a full page. An application can add methods as needed to override these defaults.

    (defmethod scroll-increment ((window basic-pane)(type (eql :line))
    			     (direction (eql :vertical)))
      (line-height window))

    (defmethod scroll-increment ((window basic-pane)(type (eql :line))
    			     (direction (eql :horizontal)))
      (space-width window))

    (defmethod scroll-increment ((window basic-pane)(type (eql :page))
    			     (direction (eql :vertical)))
      (i- (visible-box-height window)
          (line-height window)))

    (defmethod scroll-increment ((window basic-pane)(type (eql :page))
    			     (direction (eql :horizontal)))
      (- (visible-box-width window)
         (space-width window)))

Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version