▼ |  | Dr Racket Plugins

1 | Dr Racket 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

On this page:

drracket: get/ extend: extend-unit-frame
drracket: get/ extend: get-unit-frame
drracket: get/ extend: extend-tab
drracket: get/ extend: get-tab
drracket: get/ extend: extend-definitions-text
drracket: get/ extend: get-definitions-text
drracket: get/ extend: extend-interactions-text
drracket: get/ extend: get-interactions-text
drracket: get/ extend: extend-definitions-canvas
drracket: get/ extend: get-definitions-canvas
drracket: get/ extend: extend-interactions-canvas
drracket: get/ extend: get-interactions-canvas
drracket: get/ extend: disallow-re-extension!
drracket: get/ extend: allow-re-extension!

top ← prev up next →

### 13`` drracket:get/extend

> > procedure

> > (drracket:get/extend:extend-unit-frame |
> > |  | mixin |
> > | [ | before |
> > |  | #:name-for-changes name-for-changes]) |

> → void?
> mixin : (make-mixin-contract drracket:unit:frame%)
> before : boolean? = #t
> name-for-changes : (or/c #f symbol?) = #f

Extends the class that is used for the frame that implements the main DrRacket window.

The before argument controls if the mixin is applied before or after already installed mixins.

If name-for-changes is a symbol and drracket:get/extend:allow-re-extension! has been called (without a subsequent call to drracket:get/extend:disallow-re-extension!) then calling this function replaces any earlier mixins that have been added that have the same name. Otherwise, calling this with the same name twice is an error and calling it once drracket:get/extend:get-frame has been called is an error.

> > procedure

> > (drracket:get/extend:get-unit-frame)

> → (subclass?/c drracket:unit:frame%)

Returns a class whose objects are used for the DrRacket frames.

Once this function is called, drracket:get/extend:extend-unit-frame raises an error, disallowing any more extensions.

See also drracket:get/extend:allow-re-extension!.

> > procedure

> > (drracket:get/extend:extend-tab |
> > |  | mixin |
> > | [ | before |
> > |  | #:name-for-changes name-for-changes]) |

> → void?
> mixin : (make-mixin-contract drracket:unit:tab<%>)
> before : boolean? = #t
> name-for-changes : (or/c #f symbol?) = #f

Like drracket:get/extend:extend-unit-frame, except it extends the class that implements the tabs in DrRacket. One is created for each tab in a frame (each frame always has at least one tab, even if the tab bar is not shown).

> > procedure

> > (drracket:get/extend:get-tab)

> → (implementation?/c drracket:unit:tab<%>)

Like drracket:get/extend:get-unit-frame, except it returns the class used for tabs.

> > procedure

> > (drracket:get/extend:extend-definitions-text |
> > |  | mixin |
> > | [ | before |
> > |  | #:name-for-changes name-for-changes]) |

> → void?

> mixin

> :

> (make-mixin-contract drracket:unit:definitions-text<%>
> editor:standard-style-list<%>
> editor:info<%>
> racket:text<%>
> text:all-string-snips<%>
> text:file<%>
> text:info<%>
> text:wide-snip<%>)

> before : boolean? = #t
> name-for-changes : (or/c #f symbol?) = #f

Like drracket:get/extend:extend-unit-frame, except this text is used in the top window of DrRacket frames.

> > procedure

> > (drracket:get/extend:get-definitions-text)

> →

> (and/c (implementation?/c drracket:unit:definitions-text<%>)
> (implementation?/c editor:standard-style-list<%>)
> (implementation?/c editor:info<%>)
> (implementation?/c racket:text<%>)
> (implementation?/c text:all-string-snips<%>)
> (implementation?/c text:file<%>)
> (implementation?/c text:info<%>)
> (implementation?/c text:wide-snip<%>))

Like drracket:get/extend:get-unit-frame, except for the text that is used in the top window of DrRacket frames.

> > procedure

> > (drracket:get/extend:extend-interactions-text |
> > |  | mixin |
> > | [ | before |
> > |  | #:name-for-changes name-for-changes]) |

> → void?
> mixin : (make-mixin-contract drracket:rep:text<%>)
> before : boolean? = #t
> name-for-changes : (or/c #f symbol?) = #f

Like drracket:get/extend:extend-unit-frame, except it extends the class that implements the the editor in the interactions window.

> > procedure

> > (drracket:get/extend:get-interactions-text)

> → (implementation?/c drracket:rep:text<%>)

Like drracket:get/extend:get-unit-frame except it returns the class that implements the editor in the interactions window.

> > procedure

> > (drracket:get/extend:extend-definitions-canvas |
> > |  | mixin |
> > | [ | before |
> > |  | #:name-for-changes name-for-changes]) |

> → void?
> mixin : (make-mixin-contract drracket:unit:definitions-canvas%)
> before : boolean? = #t
> name-for-changes : (or/c #f symbol?) = #f

Like drracket:get/extend:extend-unit-frame, except it extends the class that implements the definitions window’s editor-canvas%.

> > procedure

> > (drracket:get/extend:get-definitions-canvas)

> → (subclass?/c drracket:unit:definitions-canvas%)

Like drracket:get/extend:get-unit-frame except it returns the class that implements the definitions window’s editor-canvas%.

> > procedure

> > (drracket:get/extend:extend-interactions-canvas |
> > |  | mixin |
> > | [ | before |
> > |  | #:name-for-changes name-for-changes]) |

> → void?
> mixin : (make-mixin-contract drracket:unit:interactions-canvas%)
> before : boolean? = #t
> name-for-changes : (or/c #f symbol?) = #f

Like drracket:get/extend:extend-unit-frame, except it extends the class that implements the interactions window’s editor-canvas%.

> > procedure

> > (drracket:get/extend:get-interactions-canvas)

> → (subclass?/c drracket:unit:interactions-canvas%)

Like drracket:get/extend:get-unit-frame except it returns the class that implements the definitions window’s editor-canvas%.

> > procedure

> > (drracket:get/extend:disallow-re-extension!) → void?

Once this is called, re-extension of the mixins described in this section is not allowed. This is the default state of mixin extension, but it can be changed by drracket:get/extend:allow-re-extension!.

> > procedure

> > (drracket:get/extend:allow-re-extension!) → void?

Once this is called, re-extension of the mixins described in this section are now allowed (see drracket:get/extend:extend-unit-frame for details of how to effect a re-extension).

This mode is intended to support a faster development cycle, not for production code. Specifically, the issue is that replacing mixins in this manner does not affect any objects that have already been create and thus there can, in general, be a mixture of old and new objects in a single DrRacket. If some kind of systematic change to the classes is wanted, consider instead using the racket/surrogate library.

Once an extension happens, newly created objects will use the new mixins. Mostly, however, creating a new frame will create a new set of all of the objects that are extended in this section, so that can be used to experiment more quickly with changes.

top ← prev up next →