The attached patch fixes bug when I'm trying to copy pixmap to medium-var inside the body of with-output-to-pixmap macro. The explanation below.
From CLIM 2.0 (LispWorks)
with-output-to-pixmap [Macro] Arguments: (medium-var medium &key width height) &body body
Summary: Binds `medium-var' to a "pixmap medium" (that is, a medium that does output to a pixmap with the characteristics appropriate to the medium `medium') and then evaluates body in that context. All the output done to the medium designated by `medium-var' inside of body is drawn on the pixmap stream. The pixmap medium supports the medium output protocol, including all of the graphics functions. `width' and `height' are integers that give the dimensions of the pixmap. If they are omitted, the pixmap will be large enough to contain all the output done by body. `medium-var' must be a symbol; it is not evaluated. The returned value is a pixmap that can be drawn onto medium using copy-from-pixmap.
As soon as "The pixmap medium supports the medium output protocol, including all of the graphics functions." then the copy-from-pixmap also has to work inside with-output-to-pixmap macro. I've written simple and quick example (attached) to illustrate this. In the handle-repaint method the temporary pixmap `temp-pixmap' is created with yellow background and filled circle in centre. Then `temp-pixmap' is copied with copy-from-pixmap inside with-output-to-pixmap macro into newly created `target-pixmap' and the second circle is drawn above. Finally the `target-pixmap' is copied to canvas. (copy-from-pixmap-test::run) to run the example.
On Tue, May 19, 2009 at 6:02 AM, Evgeny M. Zubok evgeny.zubok@tochka.ru wrote:
The attached patch fixes bug when I'm trying to copy pixmap to medium-var inside the body of with-output-to-pixmap macro. The explanation below.
Thanks; I've applied your patch. I moved the method to pixmaps.lisp due to a problem with the build order.