On this page:
stretchable-editor-snip-mixin
stretchable-editor-snip%
fixed-width-label-snip
tabbable-text<%>
set-caret-owner
set-ahead
set-back
tabbable-text-mixin
set-tabbing
grey-editor-snip-mixin
grey-editor-mixin
single-line-text-mixin
cue-text-mixin
cue-text%
clear-cue-text
Version: 4.1

4 Helpers

stretchable-editor-snip-mixin : (class? . -> . class?)

  argument extends/implements: 

editor-snip%

  result implements: 

stretchable-snip<%>

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%

stretchable-editor-snip% : class?

  superclass: editor-snip%

  extends: 

stretchable-editor-snip-mixin

 

editor-snip%

(new stretchable-editor-snip%

 

 

 [

[stretchable-width stretchable-width]

 

 

 

[stretchable-height stretchable-height]])

 

  (is-a?/c stretchable-editor-snip%)

  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%)

  possible-labels : (listof string?)

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.

tabbable-text<%> : interface?

An interface for tabbing between embedded text%s.

(send a-tabbable-text set-caret-owner)  void?

Moves the caret into the tabbable-text<%>.

(send a-tabbable-text set-ahead)  void?

Called when tabbing ahead.

(send a-tabbable-text set-back)  void?

Called when tabbing backward.

tabbable-text-mixin : (class? . -> . class?)

  argument extends/implements: 

editor:keymap<%>

  result implements: 

tabbable-text<%>

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?)

  argument extends/implements: 

editor-snip%

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?)

  argument extends/implements: 

editor<%>

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?)

  argument extends/implements: 

editor:keymap<%>

Restricts a text to one line by overriding its key bindings to do nothing on enter.

cue-text-mixin : (class? . -> . class?)

  argument extends/implements: 

text%

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.

cue-text% : class?

  superclass: (cue-text-mixin text%)

(new cue-text%

 [

[cue-text cue-text]

 

 

 

 

 

 

[color color]

 

 

 

 

 

 

[behavior behavior]])

 

 

(is-a?/c cue-text%)

  cue-text : string? = ""

  color : string? = "gray"

  

behavior

 

:

 

(listof (one-of/c 'on-focus 'on-char))

 

 

 

=

 

'(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.