hi all<div dir="ltr">I
am beginning in scheme language: I don't understant this:<br><br><i>;------------------------------------------------------------------------------------<br> #lang scheme/gui<br> (define f (new frame%<br> (label "test") )) <br>
<br><br>(define c (new canvas%<br> (parent f) <br> (min-width 200)<br> (paint-callback (ë (canvas dc)<br> (send dc clear)))))<br>
<br><br> (define dc (send c get-dc)) <br><br>(send dc set-background (make-object color% "red"))<br><br>(send dc draw-rectangle 0 0 50 50) <br> <br>(send f show #t )</i><br><br>;---------------------------------------------------------------------------------------<br>
<br>Why set-background work : I see my canvas red; but draw-rectangle doesn't work there are no rectangle in my canvas.<br><br>I try to delete set-background line but I don't see my rectangle.<br><br>so I know if I put <i>(send dc draw-rectangle 0 0 50 50) </i>in paint-callback it will work .<br>
<br>But i want draw a rectangle not directly in my canvas class.<br><br><br>Thanks.<br><i></i></div>