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

Single-line terminal combo box.

The widget keeps the value constrained to a predefined list. In terminal mode, the selection is changed with ENTER, SPACE, LEFT, RIGHT, or a mouse click.

combo = ComboBox("Level", ["none", "low", "medium", "high"], "medium")
print(combo.selectedValue)
Inherited Attributes
attributeInherited Attributes from Widget: lastRenderAnsi, lastRenderHeight, lastRenderPlain, lastRenderWidth, layout, visible
Properties
Modifier and Type Member Description
public property bgFocus
bgFocus as String = "\u001b[48;2;56;72;84m"
No summary.
public property bgNormal
bgNormal as String = "\u001b[48;2;44;44;48m"
No summary.
public property fgFocus
fgFocus as String = "\u001b[38;2;255;255;255m"
No summary.
public property fgNormal
fgNormal as String = "\u001b[38;2;245;245;245m"
No summary.
public override readonly property focusable
focusable as Boolean
No summary.
public override property focused
focused as Boolean
No summary.
public property id
id as String = ""
No summary.
public property label
label as String = ""
No summary.
public property labelWidth
labelWidth as Int = 18
No summary.
public property options
options as ArrayList<String>
No summary.
public property selectedValue
selectedValue as String
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 selectedIndex
selectedIndex as Int
No summary.
Constructors
Modifier and Type Member Description
public ComboBox
ComboBox(label as String = "", options as ArrayList<String> = null, selectedValue as String = "", labelWidth as Int = 18)
No summary.
Methods
Modifier and Type Member Description
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 override paintToFrame
paintToFrame(frame as TerminalFrame, row as Int, col as Int, width as Int, height as Int) as Boolean
No summary.
public selectNext
selectNext() as Void
No summary.
public selectPrevious
selectPrevious() as Void
No summary.
public selectValue
selectValue(value as String) as Void
No summary.
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