[gsharp-cvs] CVS gsharp

rstrandh rstrandh at common-lisp.net
Sat Jun 17 19:15:03 UTC 2006


Update of /project/gsharp/cvsroot/gsharp
In directory clnet:/tmp/cvs-serv3865

Modified Files:
	gui.lisp 
Log Message:
Recompute measures in a :before method on redisplay-frame-pane
as opposed to redisplay-frame-panes.  This turns out to be necessary
because redisplay-frame-panes is not always called.  In particular
redisplay-frame-pane is called from adopt-frame without going through
redisplay-frame-panes, and adopt-frame is called when Gsharp is
started from the CLIM desktop.


--- /project/gsharp/cvsroot/gsharp/gui.lisp	2006/06/14 19:20:41	1.67
+++ /project/gsharp/cvsroot/gsharp/gui.lisp	2006/06/17 19:15:02	1.68
@@ -25,13 +25,17 @@
   ((cursor :initarg :cursor :reader cursor)
    (buffer :initarg :buffer :reader buffer)))
 
-(defclass gsharp-pane (score-pane:score-pane)
+;;; exists for the sole purpose of a :before method that updates the
+;;; measures of each modified buffer.
+(defclass gsharp-pane-mixin () ())
+
+(defclass gsharp-pane (score-pane:score-pane gsharp-pane-mixin)
   ((view :initarg :view :accessor view)))	  
 
 (defvar *info-bg-color* +gray85+)
 (defvar *info-fg-color* +black+)
 
-(defclass gsharp-info-pane (info-pane)
+(defclass gsharp-info-pane (info-pane gsharp-pane-mixin)
   ()
   (:default-initargs
       :height 20 :max-height 20 :min-height 20
@@ -183,8 +187,11 @@
 	      (buffer view))
 	     (setf (score-pane:number-of-pages view) page-number))))
 
-(defmethod redisplay-frame-panes :before ((frame gsharp) &key force-p)
-  (declare (ignore force-p))
+;;; I tried making this a :before method on redisplay-frame-panes,
+;;; but it turns out that McCLIM calls redisplay-frame-pane from 
+;;; places other than redisplay-frame-panes. 
+(defmethod redisplay-frame-pane :before ((frame gsharp) (pane gsharp-pane-mixin) &key force-p)
+  (declare (ignore pane force-p))
   (mapc #'recompute-measures (buffers frame))
   (update-page-numbers frame))
 




More information about the Gsharp-cvs mailing list