[racket] how to add text-field-style behavior to rectangles drawn on a canvas

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Oct 6 10:17:21 EDT 2011

At Thu, 06 Oct 2011 16:07:01 +0200, Marijn wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 10/06/11 13:31, Matthew Flatt wrote:
> > At Thu, 06 Oct 2011 12:40:18 +0200, Marijn wrote:
> >> - - The display (a grid in my case) should create an
> >> editor-admin% which in turn should have a field to refer back to
> >> its display. When an editor becomes available to the display, the
> >> display will notify the editor of the editor-admin% instance
> >> through which it should direct its requests.
> > 
> > Yes.
> 
> I assume the notification will be done with set-admin method of
> editor<%>, but I just noticed that the docs say that "This method is
> only called by an administrator.", while above we agreed that the
> display should notify the editor. Are the docs wrong or should the
> display go through the administrator when notifying the editor of its
> administrator?

I guess I'm not sure what it means to distinguish between an action
taken by the display and one taken by the admin when the display and
admin need to collaborate.

That is, if you're displaying to a `canvas%' instance and you have some
instance of an `my-canvas-editor-admin%' class, then it doesn't really
matter whether the `(send editor set-admin ...)' call is within a
method of `canvas%', a method of `my-canvas-editor-admin%', or
somewhere else.

What should the docs say? Maybe "A call to `set-admin' is a
notification by a display that it's managing the editor through a
particular `editor-admin%' object."?



Posted on the users mailing list.