On this page:
44.5.1 Locked Text Fields
locked-text-field-mixin
set-value
locked-text-field%
locked-combo-field%
44.5.2 Union GUIs
union-container-mixin
choose
union-pane%
union-panel%
Version: 5.0.1

44.5 GUI Widgets

Carl Eastlund <cce@racket-lang.org>

 (require unstable/gui/window)

This library is unstable; compatibility will not be maintained. See Unstable for more information.

44.5.1 Locked Text Fields

These classes and mixins provide text and combo field controls that cannot be directly edited by the user, but may be updated by other controls.

locked-text-field-mixin : (class? . -> . class?)
  argument extends/implements: text-field%
This mixin updates text field classes to prevent user edits, but allow programmatic update of the text value. It also sets the undo history length to a default of 0, as user undo commands are disabled and the history takes up space.

(new locked-text-field-mixin [[undo-history undo-history]])
  (is-a?/c locked-text-field-mixin)
  undo-history : exact-nonnegative-integer? = 0
The mixin adds the undo-history initialization argument to control the length of the undo history. It defaults to 0 to save space, but may be set higher.

The mixin inherits all the initialization arguments of its parent class; it does not override any of them.

(send a-locked-text-field set-value str)  void?
  str : string?
Overrides set-value in text-field%.
Unlocks the text field’s nested editor, calls the parent class’s set-value, and then re-locks the editor.

44.5.2 Union GUIs

union-container-mixin : (class? . -> . class?)
  argument extends/implements: area-container<%>
This mixin modifies a container class to display only one of its child areas at a time, but to leave room to switch to any of them.

(send an-union-container choose child)  void?
  child : (is-a?/c subwindow<%>)
This method changes which of the container’s children is displayed. The chosen child is shown and the previous choice is hidden.

union-pane% : class?

  superclass: pane%

union-panel% : class?

  superclass: panel%