TextDisplay

A read-only text display. It is based on the editable widget base, but does not allow user edits and displays it on the direct background instead of on an editable background.

class TextDisplay : EditableTextWidget {}

Inherited Members

From EditableTextWidget

wordWrapEnabled
void wordWrapEnabled(bool enabled)

Enables or disables wrapping of long lines on word boundaries.

selectAll
void selectAll()

Selects all the text in the control, as if the user did it themselves. When the user types in a widget, the selected text is replaced with the new input, so this might be useful for putting in default text that is easy for the user to replace.

copy
void copy()
cut
void cut()
paste
void paste()

Basic clipboard operations.

undo
void undo()
content
string content [@property getter]
string content [@property setter]

Gets or sets the current content of the control, as a plain text string. Setting the content will reset the cursor position and overwrite any changes the user made.

addText
void addText(string txt)

Appends some text to the widget at the end, without affecting the user selection or cursor position.

Meta

History

Added October 31, 2023 (dub v11.3)