[plt-scheme] MrEd: on-paint vs. on-event in canvas%
At Tue, 26 Nov 2002 02:53:28 -0500 (EST), Doug Orleans wrote:
> 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.
Yes - that's all.
> 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?
Yes.
> Why is there no on-event in window<%>?
Mostly historial. Once upon a time (in the original wx code),
`on-event' was in window%. Half the time, it didn't work, so I took it
out. Meanwhile, I discovered the need for `on-subwindow-event', and I
spent a couple of years making it work reliably. Now that it works,
restoring `on-event' would be fairly easy, but it hasn't seemed
necessary so far.
Matthew