[plt-scheme] move-to in refresh

From: Mike T. Machenry (dskippy at ccs.neu.edu)
Date: Thu Aug 5 15:40:00 EDT 2004

Just a side note that I forgot to mention, this program does not hang if 'e' 
is a text% instead of a pasteboard%

-mike

On Thu, Aug 05, 2004 at 01:31:59PM -0400, Mike T. Machenry wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> Is it not allowed to call move-to from within refresh? This program hangs on 
> the call to move-to.
> 
> (require
>  (lib "class.ss")
>  (lib "mred.ss" "mred"))
> 
> (define aligned-pasteboard%
>   (class pasteboard%
>     (inherit move-to)
>     (rename [super-refresh refresh])
>     (define/override (refresh x y w h d-c)
>       (super-refresh x y (max w 0) (max h 0) d-c)
>       (move-to s4 0 1))
>     (super-new)))
> 
> (define f (new frame% (label "f") (width 400) (height 400)))
> (define e (new pasteboard%))
> (define c (new editor-canvas% (parent f) (editor e)))
> (define ap (new aligned-pasteboard%))
> (define es (new editor-snip% (editor ap)))
> (define s4 (make-object string-snip% "a4"))
> (send ap insert s4)
> (send f show #t)
> (send e insert es)
> 
> -mike


Posted on the users mailing list.