Dialog
classin packageklyn.gui.terminal
public class Dialog extends Widget:
└ Widget
└ Dialog

Base modal dialog.

Dialog actions use the same event model as other GUI widgets: subscribe with +=, unsubscribe with -=, and let accept() or cancel() emit a typed ActionEvent.

dialog = ConfirmDialog(Terminal.instance, "Confirm", "Continue?")
dialog.accepted += lambda(event: ActionEvent): print("accepted")
dialog.cancelled += lambda(event: ActionEvent): print("cancelled")
dialog.show()
Fields
Modifier and Type Member Description
public terminal
terminal as Terminal = null
No summary.
public title
title as String = ""
No summary.
Inherited Attributes
attributeInherited Attributes from Widget: lastRenderAnsi, lastRenderHeight, lastRenderPlain, lastRenderWidth, layout, visible
Inherited Properties
propertyInherited Properties from Widget: focusable, focused, lastRenderFrame, position, size
propertyInherited Properties from Object: type
Events
Modifier and Type Member Description
public event accepted
accepted as ActionEvent
Emitted when the dialog is accepted.
public event cancelled
cancelled as ActionEvent
Emitted when the dialog is cancelled.
Constructors
Modifier and Type Member Description
public Dialog
Dialog(terminal as Terminal, title as String):
No summary.
Methods
Modifier and Type Member Description
public accept
accept() as Void:
Accepts the dialog, emits accepted, and closes it.
public cancel
cancel() as Void:
Cancels the dialog, emits cancelled, and closes it.
public close
close() as Void:
No summary.
public show
show() 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, toDict, toJson, toString, toXml