4 Extending the Existing DrRacket Classes
Each of the names:
is bound to an extender function. In order to change the
behavior of DrRacket, you can derive new classes from the
standard classes for the frame, texts, canvases. Each
extender accepts a function as input. The function it
accepts must take a class as it’s argument and return a
classes derived from that class as its result. For example:
| (drracket:get/extend:extend-interactions-text |
| (lambda (super%) |
| (class super% |
| (define/public (method1 x) ...) |
| (super-new)))) |
extends the interactions text class with a method named method1.