[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:07:20 EDT 2011

At Thu, 06 Oct 2011 15:13:01 +0200, Marijn wrote:
> Hash: SHA1
> On 10/06/11 13:31, Matthew Flatt wrote:
> > At Thu, 06 Oct 2011 12:40:18 +0200, Marijn wrote:
> >> - - The get-max-view method is not used to determine a bounding
> >> box of all displays of this editor in display coordinates (which
> >> doesn't even make sense).
> > 
> > Indeed, it would make no sense if it were in display coordinates.
> > Like `get-view', the result is in editor coordinates.
> > 
> >> Instead it is used to determine the union of all regions in the
> >> editor which are viewed in some display. But how does get-view 
> >> know which of the displayed regions if there are multiple to
> >> return? And how does get-dc then know of which display to return
> >> the dc and upper left corner?
> > 
> > Hopefully these questions are answered by the result being in
> > editor coordinates.
> Unfortunately this part is still unclear. Suppose an editor has
> multiple views of let's say non-overlapping rectangles of the editor.
> Are both views managed by the same editor-admin or does the editor
> need to be switched between different editor-admins? 

The admins have to cooperate. Currently, only the admins for
`editor-canvas%' cooperate so that an editor can be shown in multiple
canvases (e.g., to split the definitions are in DrRacket). No general
cooperation protocol is currently in place for arbitrary admins, which
means that an editor cannot be embedded in some other editor and also
shown in its own canvas.

> In case of
> multiple administrators, the current administrator would determine the
> ``active'' view, but the administrators would have to know of
> eachother's existence to be able to produce a correct response to
> get-max-view. 


> In case of a single administrator managing multiple
> views, knowing about all the views is trivial, but what determines the
> active view that is returned by get-view?

>From the editor's perspective, it has only one admin at a time. I think
`get-max-view' is the one place where the possibility of cooperating
admins shows through the `editor-admin%' API.

Posted on the users mailing list.