All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

NextPrevUpTopContentsIndex

update-internal-scroll-parameters

Function
Summary

Updates the internal scroll parameters.

Package

capi

Signature

update-internal-scroll-parameters pane scroll-dimension scroll-operation scroll-value

Arguments

pane

A pane that supports scrolling.

scroll-dimension

:vertical, :horizontal or :pan.

scroll-operation

:drag, :move, :step or :page.

scroll-value

An integer, or a list of two integers, or a keyword, or a list of two keywords.

Description

The function update-internal-scroll-parameters updates the internal scroll parameters of pane (the ones you read by with-geometry, or get-vertical-scroll-parameters and get-horizontal-scroll-parameters), according to its arguments. The arguments pane , scroll-dimension , scroll-operation and scroll-value are interpreted the same way as the arguments to scroll. update-internal-scroll-parameters does not affect the display and does not perform any drawing.

Notes

update-internal-scroll-parameters is needed only when pane is an output-pane created with initargs :coordinate-origin :fixed or :coordinate-origin :fixed-graphics (see output-pane scrolling). It normally should not be used when :coordinate-origin is not supplied or :coordinate-origin :scrolled is supplied (the default).

The other way of setting the scroll parameters is using set-vertical-scroll-parameters and set-horizontal-scroll-parameters.

update-internal-scroll-parameters is intended to be used in your scroll-callback (see simple-pane and output-pane scrolling). It changes the internal parameters in the same way that ordinary scrolling would change them for the same arguments, so it gives a consistent behavior with the rest of the application. You will still need to draw the appropriate things in the display-callback .

For example, scrolling needs to update the display based on the values of the scroll parameters before and after the scrolling happened, you can define a scroll-callback like this:

(defun my-scroll-callback (self scroll-dimension
                                scroll-operation 
                                scroll-value)
  (with-geometry self
    (let ((prev-scroll-x %scroll-x%)
          (prev-scroll-y %scroll-y%))
 
      (update-internal-scroll-parameters 
       self scroll-dimension 
       scroll-operation scroll-value)
 
      (let ((new-scroll-x %scroll-x%)
            (new-scroll-y %scroll-y%))
 
        (update-display self
                        prev-scroll-x prev-scroll-y 
                        new-scroll-x new-scroll-y)))))
See also

set-vertical-scroll-parameters
set-horizontal-scroll-parameters.
simple-pane
output-pane
output-pane scrolling


CAPI User Guide and Reference Manual (Macintosh version) - 3 Aug 2017

NextPrevUpTopContentsIndex