[plt-scheme] move-to in refresh

From: Mike T. Machenry (dskippy at ccs.neu.edu)
Date: Mon Aug 9 12:50:19 EDT 2004


What do you make of this? This program hangs on the call to 
super-get-extent. I just cvs updated to make sure I got the latest changes.

(module on-show-pasteboard mzscheme
   (lib "class.ss")
   (lib "etc.ss")
   (lib "mred.ss" "mred"))
  (define (on-show-pasteboard-mixin super%)
    (class super%
      (field [shown? false])
      (rename [super-get-extent get-extent])
      (define/override (get-extent w h)
	(super-get-extent w h)
	(unless shown?
	  (set! shown? true)
      (define/public (showing?) shown?)
      (define/public (on-show) (void))
  (define f (new frame% (label "f") (width 400) (height 400)))
  (send f show true)
  (define e (new pasteboard%))
  (define c (new editor-canvas% (editor e) (parent f)))
  (define pb (new on-show-pasteboard%))
  (define es (new editor-snip% (editor pb)))
  (not (send pb showing?))
  (send e insert es)
  (send pb showing?)
  (send e remove es)
  (not (send pb showing?))


On Thu, Aug 05, 2004 at 09:40:16PM -0700, Matthew Flatt wrote:
> At Thu, 5 Aug 2004 19:58:57 -0400, "Mike T. Machenry" wrote:
> > My aligned-pasteboards need to know the sizes of the snips they contain in 
> > order to know how to align them in a geometry managed layout. Snips within a 
> > pasteboard do not get sizes until the pasteboard is displayed. This means 
> > if snips are inserted into an aligned-pasteboard before they it is displayed 
> > they will be layed out as if their sizes were all zero. What needs to happen 
> > is when an aligned-pasteboard is finally displayed something needs to poke 
> > it and say "hey the snips in you have real sizes now, recalculate the layout 
> > before we draw you to the screen"
> Ah --- you want to override `get-extent', and I see that, for some
> reason, it wasn't made overrideable.
> Fixed in the exp-tagged source (v208.1).
> Matthew

Posted on the users mailing list.