I'd like to report a bug with canvases when used with scroll bars. If you run the following code, it creates a 2048x2048 canvas, then places it into a scrolled pane. You can scroll the canvas, but it will not repaint when you stop scrolling. Even forcing a gs:update (click on canvas) will not repaint it.
However, changing the window size will, which proves that scrollable large canvases should be doable, just maybe an event isn't getting propagated correctly on the Java side?
Thanks very much!
Code: Select all
(load (append (env "NEWLISPDIR") "/guiserver.lsp"))
(gs:init)
(define (canvas-unclick)
"( --) Handler for mouse button release."
(gs:update)) ;; Note that this doesn't work.
(define (layout)
"( --) Layout GUI."
(gs:canvas 'Canvas)
(gs:mouse-released 'Canvas 'canvas-unclick)
(gs:panel 'Stretcher 2048 2048)
(gs:set-border-layout 'Stretcher)
(gs:add-to 'Stretcher 'Canvas "center")
(gs:scroll-pane 'Workspace 'Stretcher)
(gs:frame 'F 0 0 800 600 "Scrolling Canvas Test")
(gs:add-to 'F 'Workspace)
(gs:fill-rect 'shape 50 50 500 500 '(1 1 0))
(gs:fill-rect 'shape 250 250 500 500 '(0 1 0))
(gs:fill-rect 'shape 500 500 500 500 '(0 1 1))
(gs:set-visible 'F true))
(layout)
(gs:listen)