[mcclim-devel] [patch] with-output-to-pixmap without sizes given
Rudi Schlatte
rudi at constantly.at
Fri Sep 2 12:42:40 UTC 2005
Hi,
I hacked with-output-to-pixmap so :width and :height need not be
given. I'm generally confused about various aspects of [Mc]CLIM, but
the following code (adapted from Franz's CLIM manual) was observed to
paint a something at mouse click position, so it might just work.
Patch is attached.
(define-test-command (test-pixmaps :menu t) ()
(let* ((stream (get-frame-pane *application-frame* 'display))
(medium (clim:sheet-medium stream)))
(let ((pixmap (clim:with-output-to-pixmap (mv stream)
(with-drawing-options (mv :ink +red+)
(clim:draw-circle* mv 50 50 20 :filled t)
(clim:draw-rectangle* mv 0 0 90 90 :filled
nil)))))
(multiple-value-bind (x y)
(block get-position
(clim:tracking-pointer (stream)
(:pointer-button-press (x y)
(return-from get-position (values x y)))))
(clim:copy-from-pixmap
pixmap 0 0 (clim:pixmap-width pixmap) (clim:pixmap-height
pixmap)
medium x y)))))
Cheers,
Rudi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: w-o-t-p.patch
Type: application/octet-stream
Size: 2154 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/mcclim-devel/attachments/20050902/6de941fb/attachment.obj>
-------------- next part --------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.common-lisp.net/pipermail/mcclim-devel/attachments/20050902/6de941fb/attachment.sig>
More information about the mcclim-devel
mailing list