5 Extending the Existing DrRacket Classes

▼ |  | Dr Racket Plugins

1 | Tool support for #lang-based Languages
2 | Implementing Dr Racket Plugins
3 | Adding Languages to Dr Racket
4 | Creating New Kinds of Dr Racket Frames
5 | Extending the Existing Dr Racket Classes
6 | Expanding the User’s Program Text and Breaking
7 | Editor Modes
8 | Plugin Capabilities
9 | Check Syntax
10 | Cooperating with Background Check Syntax
11 | Teaching Languages
12 | Signatures
13 | drracket: get/ extend
14 | drracket: unit
15 | drracket: language
16 | drracket: language-configuration
17 | drracket: debug
18 | drracket: rep
19 | drracket: frame
20 | drracket: help-desk
21 | drracket: eval
22 | drracket: modes
23 | drracket: module-language-tools
24 | drracket: module-language
25 | drracket: tracing
26 | drracket: init
27 | Backwards Compatibility
| Index

Racket
top contents ← prev up next →

## 5 Extending the Existing DrRacket Classes🔗ℹ

Each of the names:

- drracket:get/extend:extend-interactions-text

- drracket:get/extend:extend-definitions-text

- drracket:get/extend:extend-interactions-canvas

- drracket:get/extend:extend-definitions-canvas

- drracket:get/extend:extend-unit-frame

- drracket:get/extend:extend-tab

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 its 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.
top contents ← prev up next →