Lisp HUG Maillist Archive

automatic scrolling and resizing

I have a pinboard pane with a horizontal scroll bar.  When the slug is
as far right as it can go and the user widens the window, CAPI moves
the slug position back.  What I would like to do instead is leave the
slug position unchanged and increase the scroll range, but I can't
find a place I can get at to do that early enough.  As far as I can
tell, by the time any of my callbacks are called, the slug position
has already been moved back.  Is there some place I can hook into
before that happens?

(capi:contain
 (make-instance 'capi:pinboard-layout
     :pane-can-scroll nil
     :scroll-start-x 0
     :scroll-width 250
     :scroll-initial-x 50
     :horizontal-scroll t
     :scroll-callback
     (lambda (pane &rest args)
       (format t "~&scroll callback: slug ~s args ~s"
               (capi:get-horizontal-scroll-parameters
                pane :slug-position)
               args))
     :resize-callback
     (lambda (pane &rest args)
       (format t "~&resize callback: slug ~s args ~s"
               (capi:get-horizontal-scroll-parameters
                pane :slug-position)
               args)))
 :best-width 215)


Re: automatic scrolling and resizing

Gail Zacharias wrote on Tue, 15 Jun 2010 10:24:03 -0400 18:24:

| I have a pinboard pane with a horizontal scroll bar.  When the slug is
| as far right as it can go and the user widens the window, CAPI moves
| the slug position back.  What I would like to do instead is leave the
| slug position unchanged and increase the scroll range, but I can't
| find a place I can get at to do that early enough.  As far as I can
| tell, by the time any of my callbacks are called, the slug position
| has already been moved back.  Is there some place I can hook into
| before that happens?
| 
| (capi:contain
|  (make-instance 'capi:pinboard-layout
|      :pane-can-scroll nil
|...snip...| 

I believe you have to specify :pane-can-scroll t and invoke
capi:set-horizontal-scroll-parameters somewhere within the resize callback.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


Updated at: 2020-12-10 08:39 UTC