GUIServer Bug: Scrolled canvas isn't repainted.

Guiserver, GTK-server, OpenGL, PostScript,
HTML 5, MIDI, IDE

GUIServer Bug: Scrolled canvas isn't repainted.

Postby oofoe » Mon Dec 07, 2015 6:28 pm

Hi!

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)
Testing can show the presence of bugs, but not their absence.
oofoe
 
Posts: 60
Joined: Wed Sep 28, 2005 7:13 pm

Re: GUIServer Bug: Scrolled canvas isn't repainted.

Postby Lutz » Fri Dec 11, 2015 12:33 am

guiserver.jar version 1.65 now correctly forces updates of a gs:canvas in a gs:scroll-pane when scrolling.

guiserver.jar v.1.65 can be downloaded here:

http://www.newlisp.org/downloads/develo ... nprogress/


ps: (gs:mouse-released 'Canvas 'canvas-unclick) is not required, scrolling will automatically force update of the canvas.
Lutz
 
Posts: 5258
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: GUIServer Bug: Scrolled canvas isn't repainted.

Postby oofoe » Sat Dec 12, 2015 4:02 am

Christmas is early -- this works great!

The canvas-unclick function was just to show that I had tried to do a gs:update and it hadn't worked either. I wanted to give you a good example to test with.

Thanks very much!
Testing can show the presence of bugs, but not their absence.
oofoe
 
Posts: 60
Joined: Wed Sep 28, 2005 7:13 pm


Return to newLISP Graphics & Sound

Who is online

Users browsing this forum: No registered users and 1 guest