<div dir="ltr">Oh, interesting. It even does it when the mouse movements are not on top of the frame or the focus is on some other window! I'm not sure about this one.<div style><br></div><div style>Robby</div><div style>
<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 12, 2013 at 12:30 PM, Philipp Dikmann <span dir="ltr"><<a href="mailto:philipp@dikmann.de" target="_blank">philipp@dikmann.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
I'm sorry, I should have been more specific – it happens when using
a gl-enabled canvas (example below).<br>
I hope that does not turn it into a dragons' den? ;)<br>
<br>
Philipp<br>
<br>
#lang racket/gui<br>
<br>
(require sgl)<br>
<br>
(define c%<br>
(class canvas%<br>
(inherit with-gl-context swap-gl-buffers)<br>
(define/override (on-paint)<br>
(with-gl-context<br>
(lambda ()<br>
(gl-clear-color (random) (random) (random) 1)<br>
(gl-clear 'color-buffer-bit)<br>
(swap-gl-buffers)<br>
(gl-flush))))<br>
(super-new (style '(gl no-autoclear)))))<div class="im"><br>
<br>
(define f (new frame% [label ""] [width 100] [height 100]))<br>
(define c (new c% [parent f]))<br>
(send f show #t)<br>
</div><div><div class="h5"><div><br>
<br>
On 11.02.13 22:39, Robby Findler wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">I don't think it does that. The program below, at
least for me, doesn't do crazy colors when I move the mouse
around (it does when resizing, tho).
<div><br>
</div>
<div>Robby</div>
<div><br>
</div>
<div>
<div>#lang racket/gui</div>
<div><br>
</div>
<div>(define c%</div>
<div> (class canvas%</div>
<div> (inherit get-client-size get-dc)</div>
<div> (define/override (on-paint)</div>
<div> (define-values (w h) (get-client-size))</div>
<div> (define dc (get-dc))</div>
<div> (define c (make-object color% (random 255) (random
255) (random 255)))</div>
<div> (send dc set-brush c 'solid)</div>
<div> (send dc set-pen "black" 1 'transparent)</div>
<div> (send dc draw-ellipse 0 0 w h))</div>
<div> (super-new)))</div>
<div><br>
</div>
<div>(define f (new frame% [label ""] [width 100] [height
100]))</div>
<div>(define c (new c% [parent f]))</div>
<div>(send f show #t)</div>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Mon, Feb 11, 2013 at 9:41 AM,
Philipp Dikmann <span dir="ltr"><<a href="mailto:philipp@dikmann.de" target="_blank">philipp@dikmann.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It appears
that the GUI canvas% refreshes itself whenever it receives a
mouse-event%.<br>
I intend to refresh the canvas at a steady pace (using a
timer%) and independently of any mouse-events instead.<br>
Is there a reasonable way to suppress the default behavior?<br>
<br>
Thanks for your time,<br>
Philipp<br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div></div></div>
</blockquote></div><br></div>