At Fri, 07 Oct 2011 13:06:23 +0200, Marijn wrote: > I've prepared a chopped-down attempt which defines an editor, an > administrator and a display class and instantiates them. > > Unfortunately the editor doesn't appear on the screen where I thought > I'd let the administrator tell it to appear. > > I'm not sure why it doesn't work. Any help?
All windowing events go to the `canvas%', and the built-in canvas methods know nothing about your editor admin. You need to override `on-paint' to pass on the message to the editor, `on-focus' to notify the editor, `on-event' to send events on to the editor, and so on. See enclosed. I changed the direct calls to `refresh' to instead send `refresh' to the canvas, and then the canvas's `on-paint' calls the editor's `refresh'. Otherwise, you have to erase the area for the editor before redrawing the editor, and the windowing system is usually better at scheduling the refresh.
minimal-editor-admin-sample.rkt
Description: Binary data
_________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users