4 Helpers
stretchable-editor-snip-mixin : (class? . -> . class?) | ||
| ||
|
Extends an editor snip the stretchable-snip<%> interface, which allows it to be stretched to fit an alignment-parent<%>’s allotted width. Stretchable snips are useful as the snip of a snip-wrapper%
superclass: editor-snip% | ||||
|
[
[stretchable-width stretchable-width]
[stretchable-height stretchable-height]])
stretchable-width : boolean? = #t
stretchable-height : boolean? = #t
Creates a stretchable snip with the given initial stretchability.
(fixed-width-label-snip possible-labels) → (subclass?/c snip%) |
Returns a subclass of snip% that takes a single initialization argument. The argument provided when instantiating the class must be a member of possible-labels; the given label is displayed by the snip, but the snip is sized to match the longest of the labels in possible-labels.
In other words, the resulting class helps align multiple GUI elements t hat are labeled from a particular set of strings.
An interface for tabbing between embedded text%s.
(send a-tabbable-text set-caret-owner) → void?
Moves the caret into the tabbable-text<%>.
Called when tabbing ahead.
Called when tabbing backward.
tabbable-text-mixin : (class? . -> . class?) | ||
| ||
|
Adds the tabbable-text<%> interface to an editor:text% class, where instantiation installs key bindings to tab ahead and backward
(set-tabbing a-text ) → void? |
a-text : (is-a?/c tabbable-text<%>) |
Sets the tabbing order of tabbable-text<%>s by setting each text’s set-ahead and set-back thunks to point to it’s neighbor in the argument list.
grey-editor-snip-mixin : (class? . -> . class?) | ||
|
Gives an editor-snip% a colored background indicating that is disabled. The editor is not disabled by the mixin however, and must be locked separately.
grey-editor-mixin : (class? . -> . class?) | ||
|
Gives an editor<%> a colored background indicating that is disabled. The editor is not disabled by the mixin however, and must be locked separately.
single-line-text-mixin : (class? . -> . class?) | ||
|
Restricts a text to one line by overriding its key bindings to do nothing on enter.
cue-text-mixin : (class? . -> . class?) | ||
|
Gives a text% an instantiation argument of a string that is displayed in the text% initially in grey; the text disappears when the text gets focus. This technique is useful for labeling texts without needing to take up space.
superclass: (cue-text-mixin text%) |
[
[cue-text cue-text]
[color color]
[behavior behavior]])
→
cue-text : string? = ""
color : string? = "gray"
behavior
:
=
'(on-focus)
Creates an instance with the given initial content, color, and behvior for when to clear the text.
(send a-cue-text clear-cue-text) → void?
Clears the cue text, if it’s still present.