I replied too early. If you run the following program,
;; v.188.8.131.52 (require 2htdp/universe) (require 2htdp/image) (define mt (empty-scene 200 100)) (define xx 100) (define yy 50) ;; String -> String (define (main initial) (big-bang initial (on-key (lambda (w ke) ;; String KeyEvent -> String or (stop-with String) ;; add ke to w if 1String, stop with RETURN (cond [(key=? ke "\r") (stop-with w)] [(= (string-length ke) 1) (string-append w ke)] [else w]))) (stop-when (lambda (w) ;; String -> Boolean (= (string-length w) 10)) (lambda (w) ;; String -> Image (place-image (text w 22 'red) xx yy mt))) (on-draw (lambda (w) ;; String -> Image (place-image (text w 22 'black) xx yy mt))))) (main "") (main "0123456789") you will see that regardless how the final state comes about, the text is colored red meaning it goes through the last-picture rendering function. If I misunderstood your request, please explain more carefully. Merry Christmas — Matthias > On Dec 24, 2017, at 3:38 PM, Matthias Felleisen <matth...@ccs.neu.edu> wrote: > > >> On Dec 18, 2017, at 11:05 AM, A Mauer-Oats <mauero...@gmail.com> wrote: >> >> I recently came across the following behavior in big-bang that was new to me. >> I am writing in case I have misunderstood something. >> >> 1. (stop-with model) does not run the draw handler one last time >> (this is documented but I'm not sure why this choice was made) > > > I can’t find this in the documentation. It promises the same properties as > stop-when (based on my reading). > > >> This means that a conditional in the draw handler cannot be used to draw a >> "win screen". >> >> 2. (stop-when predicate? final-draw-handler) >> the final-draw-handler runs at the stop of the animation, even if predicate? >> does not cause the animation to stop > > > I don’t know what you mean by this last sentence. If predicate? is never > true, the final-draw-handler won’t be called. > > >> The final-draw-handler is a fine creation. >> If we had access to it without the predicate? then students could use >> stop-when and get their win screen drawn without any extra baggage. >> For example: >> (to-draw ...) >> (to-draw-final ...) >> >> In addition, perhaps there could be an option / default of making the final >> draw handler be the same as the ordinary draw handler. > > In my experience, the last picture shows something rather different than the > regular one. (With apologies to McMurtry.) > > I will think about this and come up with a solution. — Matthias > > > > > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.