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

From: Marijn (hkBst at gentoo.org)
Date: Thu Oct 6 11:46:17 EDT 2011

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/06/11 16:17, Matthew Flatt wrote:
> 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.

Right, so then the docs shouldn't say that the call is only done by
administrators if actually displays can also do it and actually there
is no meaningful difference, besides maybe not cleanly separating
concerns between an administrator and a display.

> 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.

Right.

> 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."?

As far as I understand the administrator objects are supposed to be
invisible to the user and if no initial editor is supplied to an
editor-canvas, then supplying an editor to a canvas with the
set-editor canvas-method will result in some call to set-admin on the
editor and maybe also a add-canvas call on the editor. Which things
need/should go through an administrator is something I'm trying to
figure out.

Marijn

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6NzUkACgkQp/VmCx0OL2ydwgCfU3Vky6utWIDeD4W8/7zY2UsS
qgQAn1wF2ghgHQw56zEObH6FOvwJWzqh
=YTSn
-----END PGP SIGNATURE-----


Posted on the users mailing list.