Lisp HUG Maillist Archive

Problem with rendering scrolled output-panes in row-layouts

When I run the following code (Mac, current OS) in LW Pro and use the scrollbars to scroll, I get white striping in my colored TEST-PANEs, the more so if I scroll slowly. On the other hand, the text seems to render perfectly. Presumably all the drawing takes place in callbacks. So why is this happening?

A second problem is that the BIG-PANE’s vertical scrollbar isn’t displayed unless I’ve scrolled to its right-most edge.

(This is a side issue that may come up, but ultimately I want a layout that has a header that does not scroll vertically but does scroll horizontally. Think of a calendar with a list of employees. The employee names should scroll vertically with the days but not horizontally. I understand that ultimately I may have to create my own scrollbars to get the desired behavior. Today I’ll settle for fixing the rendering problem.)

Thanks for your help.

Laughing Water


(defclass test-pane (capi:output-pane)
  ((value :accessor value :initform (random 1000)))
  (:default-initargs
   :display-callback 'draw-test-pane
   :visible-min-width 100
   :visible-max-width 100
   :visible-min-height 50))

(defun draw-test-pane (pane x y width height)
  (gp:with-graphics-state (pane :foreground :light-blue)
    (gp:draw-rectangle pane 0 0 width height :filled t))
    (gp:with-graphics-state (pane :foreground :black)
        (gp:draw-string pane (format nil "~A" (value pane)) 5 20)))

(defun make-test-rows ()
  (loop for i below 50
        collect
        (make-instance
         'capi:row-layout
         :uniform-size-p nil
         :min-column-width 100
         :visible-min-height 50
         :visible-max-height 50
         :description
         (loop for d below 7
                collect
                (make-instance 'test-pane)))))

(capi:define-interface scroll-test-interface ()
  ()
  (:panes
   (header capi:title-pane
           :accessor header
           :text "I don't want this header to scroll vertically.")
   (big-pane capi:column-layout
             :accessor big-pane
             :description (make-test-rows)
             :y-gap 3
             :uniform-size-p nil
             :visible-max-height nil
             :visible-max-width nil
             :vertical-scroll t))
  (:layouts
   (main-layout capi:column-layout '(header big-pane )  :horizontal-scroll t))
  (:default-initargs :title "Scroll Test"
   :best-width 400
   :best-height 240))

(capi:display (make-instance 'scroll-test-interface))

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Problem with rendering scrolled output-panes in row-layouts

Dear LispWorks Friends,

I know you’re there. I can hear you breathing. But I’ve gotten no replies to my question from a week ago. Have I stumped the stars? Is Friday a bad day to ask questions?

Can anyone at least confirm that the problem appears on their systems?

With thanks and best wishes,
LW

> On Jul 29, 2016, at 3:58 PM, Laughing Water <lw@mt.net> wrote:
> 
> 
> When I run the following code (Mac, current OS) in LW Pro and use the scrollbars to scroll, I get white striping in my colored TEST-PANEs, the more so if I scroll slowly. On the other hand, the text seems to render perfectly. Presumably all the drawing takes place in callbacks. So why is this happening?
> 
> A second problem is that the BIG-PANE’s vertical scrollbar isn’t displayed unless I’ve scrolled to its right-most edge.
> 
> (This is a side issue that may come up, but ultimately I want a layout that has a header that does not scroll vertically but does scroll horizontally. Think of a calendar with a list of employees. The employee names should scroll vertically with the days but not horizontally. I understand that ultimately I may have to create my own scrollbars to get the desired behavior. Today I’ll settle for fixing the rendering problem.)
> 
> Thanks for your help.
> 
> Laughing Water
> 
> 
> (defclass test-pane (capi:output-pane)
>  ((value :accessor value :initform (random 1000)))
>  (:default-initargs
>   :display-callback 'draw-test-pane
>   :visible-min-width 100
>   :visible-max-width 100
>   :visible-min-height 50))
> 
> (defun draw-test-pane (pane x y width height)
>  (gp:with-graphics-state (pane :foreground :light-blue)
>    (gp:draw-rectangle pane 0 0 width height :filled t))
>    (gp:with-graphics-state (pane :foreground :black)
>        (gp:draw-string pane (format nil "~A" (value pane)) 5 20)))
> 
> (defun make-test-rows ()
>  (loop for i below 50
>        collect
>        (make-instance
>         'capi:row-layout
>         :uniform-size-p nil
>         :min-column-width 100
>         :visible-min-height 50
>         :visible-max-height 50
>         :description
>         (loop for d below 7
>                collect
>                (make-instance 'test-pane)))))
> 
> (capi:define-interface scroll-test-interface ()
>  ()
>  (:panes
>   (header capi:title-pane
>           :accessor header
>           :text "I don't want this header to scroll vertically.")
>   (big-pane capi:column-layout
>             :accessor big-pane
>             :description (make-test-rows)
>             :y-gap 3
>             :uniform-size-p nil
>             :visible-max-height nil
>             :visible-max-width nil
>             :vertical-scroll t))
>  (:layouts
>   (main-layout capi:column-layout '(header big-pane )  :horizontal-scroll t))
>  (:default-initargs :title "Scroll Test"
>   :best-width 400
>   :best-height 240))
> 
> (capi:display (make-instance 'scroll-test-interface))
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
> 


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Unable to render article 14027 because of ":DEFAULT stream decoding error on #<SB-SYS:FD-STREAM for \"socket 192.168.43.216:64170, peer: 116.202.254.214:119\" {10097ABE43}>: the octet sequence #(162) cannot be decoded." error

Unable to render article 14028 because of ":DEFAULT stream decoding error on #<SB-SYS:FD-STREAM for \"socket 192.168.43.216:64171, peer: 116.202.254.214:119\" {100A148563}>: the octet sequence #(162) cannot be decoded." error

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