[racket-dev] Q. about "live" snips

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Sep 7 20:49:41 EDT 2010

You can do that, but you need to start by making your own derived
snip% instance. There's a lot of boilerplate that goes into those
things, tho.

Robby

On Tue, Sep 7, 2010 at 5:39 PM, John Clements <clements at brinckerhoff.org> wrote:
> I'm writing code for beginners that produces "sound" values.  I'd like to render these values as snips that have a start and a stop button.
>
> My first experiment looked like this:
>
> #lang racket
>
> (require racket/gui)
>
> (define f (make-object image-snip% "/Users/clements/plt/collects/icons/mini-plt.xpm"))
>
> (define (g)
>  (send f load-file "/Users/clements/plt/collects/icons/j.gif"))
>
>
> This "worked" in the sense that the value was rendered graphically, but "didn't work" in the sense that calling (g) didn't change an already-displayed image. Viz:
>
>
>
>
> This suggests to me that it would be hard to implement a "sound-player-snip" that updated itself to display its status.
>
> My hope is that I'm wrong, and there's some easy way to make snips "live" in this sense.
>
> Any help greatly appreciated.
>
> John
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev
>


Posted on the dev mailing list.