[racket] paint-callback and dc

From: Michael W (mwilber at uccs.edu)
Date: Sun Jan 1 00:39:08 EST 2012

Yes, I think so. collects/mred/private/mrcanvas.rkt:205 defines
the on-paint method in canvas% as:

  (lambda () 
    (if (eq? paint-cb default-paint-cb)
      (super-on-paint)
      (paint-cb this (get-dc))))

where paint-cb is a field that takes paint-callback.

2 hours ago, Justin Zamora wrote:
> Is the dc% that is passed to the paint-callback for a canvas always
> the same dc% returned by (send canvas get-dc)?  In other words, are
> the following equivalent?
> 
> [paint-callback (lambda (canvas dc) (send dc clear))]
> [paint-callback (lambda (canvas dc) (send (send canvas get-dc) clear))]
> 
> Justin


Posted on the users mailing list.