[mcclim-devel] redisplay-frame-pane with named panes

Raymond Toy toy.raymond at gmail.com
Sat Dec 16 14:52:55 UTC 2006


In clasp, there are several calls like (redisplay-frame-pane clasp-frame
'notebook), where 'notebook is the name of a pane.  This always gets an
error about no method for pane-needs-redisplay with arg (notebook).

If I change the call to be (redisplay-frame-pane clasp-frame
(find-pane-named clasp-frame 'notebook)), everything works.

Assuming that redisplay-frame-pane should convert the pane name to a
pane object within the function, here is a possible replacement.  I
don't really know enough about mcclim to know if this is sensible or
not, but it works for clasp.

Ray

Index: frames.lisp
===================================================================
RCS file: /project/mcclim/cvsroot/mcclim/frames.lisp,v
retrieving revision 1.120
diff -u -r1.120 frames.lisp
--- frames.lisp	1 Jul 2006 21:00:31 -0000	1.120
+++ frames.lisp	16 Dec 2006 14:52:38 -0000
@@ -368,22 +368,25 @@

 (defmethod redisplay-frame-pane :around ((frame application-frame) pane
 					 &key force-p)
-  (multiple-value-bind (redisplayp clearp)
-      (pane-needs-redisplay pane)
-    (when force-p
-      (setq redisplayp (or redisplayp t)
-	    clearp t))
-    (when redisplayp
-      (let ((hilited (frame-hilited-presentation frame)))
-	(when hilited
-	  (highlight-presentation-1 (car hilited) (cdr hilited) :unhighlight)
-	  (setf (frame-hilited-presentation frame) nil)))
-      (with-possible-double-buffering (frame pane)
-	(when clearp
-	  (window-clear pane))
-	(call-next-method))
-      (unless (or (eq redisplayp :command-loop) (eq redisplayp :no-clear))
-	(setf (pane-needs-redisplay pane) nil)))))
+  (let ((pane-object (if (typep pane 'pane)
+			 pane
+			 (find-pane-named frame pane))))
+    (multiple-value-bind (redisplayp clearp)
+	(pane-needs-redisplay pane-object)
+      (when force-p
+	(setq redisplayp (or redisplayp t)
+	      clearp t))
+      (when redisplayp
+	(let ((hilited (frame-hilited-presentation frame)))
+	  (when hilited
+	    (highlight-presentation-1 (car hilited) (cdr hilited) :unhighlight)
+	    (setf (frame-hilited-presentation frame) nil)))
+	(with-possible-double-buffering (frame pane-object)
+	  (when clearp
+	    (window-clear pane-object))
+	  (call-next-method))
+	(unless (or (eq redisplayp :command-loop) (eq redisplayp :no-clear))
+	  (setf (pane-needs-redisplay pane-object) nil))))))

 (defmethod run-frame-top-level ((frame application-frame)
 				&key &allow-other-keys)




More information about the mcclim-devel mailing list