<div dir="ltr">You need to arrange for this line:<div><br></div><div> (send (send canvas get-dc) draw-bitmap (bitmap) 0 0)</div><div><br></div><div style>to happen whenever the canvas needs to be refreshed, either by overriding on-paint in canvas% and making the call there, or by using the paint-callback init arg.</div>
<div style><br></div><div style>Robby</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, May 19, 2013 at 7:17 PM, Tomás Coiro <span dir="ltr"><<a href="mailto:tomcoiro@hotmail.com" target="_blank">tomcoiro@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">#lang racket/gui<br>(define bitmap (make-parameter #f))<br>(define dc (make-parameter #f))<br>(define path (make-parameter #f))<br><br>(parameterize* ((bitmap (make-bitmap 500 500 #f))<br> (dc (let ((temp (new bitmap-dc% (bitmap (bitmap)))))<br>
(send temp set-pen "black" 2 'solid)<br> temp))<br> (path (new dc-path%)))<br> (define frame (new frame% [min-width (send (bitmap) get-width)]<br> [min-height (send (bitmap) get-height)]<br>
[label "test"]))<br> (send (path) move-to 50 50)<br> (send (path) line-to 250 250)<br> (send (dc) draw-path (path))<br> (define canvas (new canvas% [parent frame]))<br> (send (send canvas get-dc) draw-bitmap (bitmap) 0 0)<br>
(send frame show #t))<br><br><br>I don't know what i am doing wrong, the bitmap is drawn, if i return it i get the line all fine, the problem is that the frame either doesn't get updated or never tries to draw. Is this a bug in canvas% or am I doing something terribly wrong?<br>
                                           </div></div>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br></div>