<div dir="ltr">This does look like a bug in 2htdp/universe, tho. <div><br></div><div>Looking at the universe code, it is not dealing with the case that it gets a bitmap% object. 2htdp/image's image? predicate accepts those. Probably a diff something along these lines is the right fix (warning, untested!)</div>
<div><br></div><div><div>☕ git diff .</div><div>diff --git a/pkgs/htdp-pkgs/htdp-lib/2htdp/private/world.rkt b/pkgs/htdp-pkgs/htdp-lib/2htdp/private/world.rkt</div><div>index 103ca45..98d46ff 100644</div><div>--- a/pkgs/htdp-pkgs/htdp-lib/2htdp/private/world.rkt</div>
<div>+++ b/pkgs/htdp-pkgs/htdp-lib/2htdp/private/world.rkt</div><div>@@ -232,7 +232,10 @@</div><div> ;; Image -> Void</div><div> ;; show the image in the visible world</div><div> (define/public (show pict0)</div>
<div>- (define pict (add-game-pad pict0))</div><div>+ (define pict1 (if (is-a? pict0 bitmap%)</div><div>+ (make-object bitmap-snip% pict0)</div><div>+ pict0))</div>
<div>+ (define pict (add-game-pad pict1))</div><div> (send visible begin-edit-sequence)</div><div> (send visible lock #f)</div><div> (let ([s (send visible find-first-snip)]</div><div><br></div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 17, 2014 at 12:40 PM, Jens Axel Søgaard <span dir="ltr"><<a href="mailto:jensaxel@soegaard.net" target="_blank">jensaxel@soegaard.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<br>
<br>
Is there a way to use big-bang with picts?<br>
In other words, how can I convert a pict into something that big-bang<br>
will display?<br>
<br>
The attempt below fails with this error:<br>
<br>
collects/racket/private/class-internal.rkt:4387:0: send: no such method<br>
method name: copy<br>
class name: bitmap%<br>
<br>
#lang racket<br>
(require pict (only-in 2htdp/universe big-bang on-tick to-draw))<br>
<br>
(define (world->image w)<br>
(pict->bitmap (circle w)))<br>
<br>
(big-bang 100<br>
[on-tick add1]<br>
[to-draw world->image])<br>
<br>
<br>
--<br>
Jens Axel Søgaard<br>
<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>