LineEdit
classin packageklyn.gui.terminal
public class LineEdit extends Widget
└ Widget
└ LineEdit

Single-line editable text widget with cursor navigation, text selection, clipboard copy/cut/paste, and mouse drag selection support.

Example
edit = LineEdit("initial text")
edit.selectAll()
copied = edit.copySelection()
Inherited Attributes
attributeInherited Attributes from Widget: lastRenderAnsi, lastRenderHeight, lastRenderPlain, lastRenderWidth, layout, visible
Properties
Modifier and Type Member Description
public property bgNormal
bgNormal as String = "\u001b[48;2;44;44;48m"
No summary.
public property bgSelection
bgSelection as String = "\u001b[48;2;0;120;215m"
No summary.
public property cursorPosition
cursorPosition as Long = 0
No summary.
public property fgNormal
fgNormal as String = "\u001b[38;2;245;245;245m"
No summary.
public property fgSelection
fgSelection as String = "\u001b[38;2;255;255;255m"
No summary.
public override readonly property focusable
focusable as Boolean
No summary.
public override property focused
focused as Boolean
No summary.
public property placeholder
placeholder as String = ""
No summary.
public property placeholderFg
placeholderFg as String = "\u001b[38;2;120;130;140m"
No summary.
public property selectionAnchor
selectionAnchor as Long = -1
No summary.
public property selectionCaret
selectionCaret as Long = -1
No summary.
Inherited Properties
propertyInherited Properties from Widget: focusable, focused, lastRenderFrame, position, size
propertyInherited Properties from Object: type
Signals
Modifier and Type Member Description
public signal property text
text as String
No summary.
Constructors
Modifier and Type Member Description
public LineEdit
LineEdit(text as String = "")
No summary.
Methods
Modifier and Type Member Description
public clearSelection
clearSelection() as Void
Clears any active selection.
public copySelection
copySelection() as Boolean
Copies the active selection to the clipboard.
public cursorDisplayColumn
cursorDisplayColumn() as Int
No summary.
public cutSelection
cutSelection() as Boolean
Cuts the active selection to the clipboard and removes it from text.
public override handleEvent
handleEvent(eventName as String) as Boolean
No summary.
public override handleMouseEvent
handleMouseEvent(mouse as MouseEvent, localX as Int, localY as Int, viewWidth as Int, viewHeight as Int) as Boolean
No summary.
public hasSelection
hasSelection() as Boolean
Indicates whether a non-empty text selection is active.
public override paintToFrame
paintToFrame(frame as TerminalFrame, row as Int, col as Int, width as Int, height as Int) as Boolean
No summary.
public pasteText
pasteText(toPaste as String) as Boolean
Pastes text at the current cursor or replacing the selection.
public selectAll
selectAll() as Void
Selects all text in the widget.
public selectRange
selectRange(start as Long, finish as Long) as Void
Selects a given range of text.
public selectedText
selectedText() as String
Returns the currently selected substring.
public selectionEnd
selectionEnd() as Long
End index of the selection range, exclusive.
public selectionStart
selectionStart() as Long
Start index of the selection range, inclusive.
Inherited Methods
methodInherited Methods from Widget: add, baseAnsiStyle, captureRenderFrame, children, clearChildren, configureCursor, focusNext, handleEvent, handleMouseEvent, hasActiveTextInput, idle, paint, paintToFrame, performLayout, refresh, renderAnsiSnapshot, renderPlainSnapshot, scrollbarThumbGlyph, scrollbarTrackGlyph, terminalPromptVisible
methodInherited Methods from Object: deepCopy, fromJson, hash, toDict, toJson, toMap, toString, toXml