[racket] Drawing in the Canvas from outside

From: Alexandr M (rus314 at gmail.com)
Date: Tue Jan 27 12:09:02 EST 2015

Hello,

How can I draw the line (for example) in the canvas object defined as:

(define frame (new frame% [label ""] [width 700] [height 500]))
(define canvas (new canvas% [parent frame]
  ;;;; - call from outside:  [paint-callback (lambda (c dc) (send dc
draw-line 1 1 10 10) )]
  ))

by calling a function like

(define (MyDraw canvas-obj) .... (draw-line 1 1 10 10))

?

-- 
Best regards,
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150127/99606390/attachment.html>

Posted on the users mailing list.