CLIM mail archive

[Prev][Next][Index][Thread]

Ghost areas in application panes when reshaping




Description: an application with a display pane
sometimes gets in a state where a section of its pane
it totally unaccessible to drawing operations. This seems to occur
when a pane contains objects with negative coordinates
and has been reshaped once (e.g. extended), then no further
reshape nor scrolling has any effect on fixing the display
(e.g. the top and left sections of the pane display remain
in background color, no objects hightlight etc.).
This has happened on two CLIM2.0 versions I have tried recently.

In particular, I have recently fixed this problem for an
application by adding the following methods under CLIM2.0
Allegro 4.2. I have not tested it on other implementation
yet. But it should give a good clue as to what code may
be missing when reshaping panes that contain graphical
objects with negative coordinates... My gut feeling tells
me this may be an old problem, I observed the same behavior
on CLIM1.1 (Harlequin?) a year ago.

;;;
;;; After reshaping some application panes seem to lose a portion of their
;;; displayable region when they hold objects with negative coordinates.
;;; Call this to repair the damage:
;;;
(defmethod repair-sheet-region ((pane application-pane))
  (with-bounding-rectangle* (l1 t1 r1 b1) pane
    (with-bounding-rectangle* (l0 t0 r0 b0) (pane-viewport-region pane)
      (unless (and (eql l1 l0) (eql t1 t0))
	(setf (sheet-region pane)
	  (make-instance 'clim:standard-bounding-rectangle
	    :left (min l0 l1) :top (min t0 t1)
	    :right (max r0 r1) :bottom (max b0 b1)))))))

;;; This uses the above to repair the pane region
;;;
(defmethod note-viewport-position-changed ((frame YOUR-application-frame) (pane application-pane) x y)
  (declare (ignore x y))
  (repair-sheet-region pane))


Olivier Clarisse


Main Index | Thread Index