[plt-scheme] MrEd: on-paint vs. on-event in canvas%

From: Doug Orleans (dougo at ccs.neu.edu)
Date: Tue Nov 26 02:53:28 EST 2002

In the MrEd class canvas%, is there a deep reason why the on-paint
method invokes a callback that can be given at object construction
time, while the on-event method does nothing and needs to be
overridden in a subclass to be customized?

My guess is that the not-so-deep reason is that a canvas needs
customized painting more often than it needs customized event
handling.  But, still, it would be nice if one could make canvas%
objects that handled events without needing to make a new subclass.

(Ditto for window<%> and on-subwindow-event.  By the way, is it true
that the only way to handle an event in a non-canvas window (e.g. a
panel%) is by having on-subwindow-event check that its first two
arguments are equal?  Why is there no on-event in window<%>?)

--dougo at ccs.neu.edu

Posted on the users mailing list.