Skip to content

WidgetState

[Source]

Bundles the common fields every widget needs. Stored as a single field on the actor and exposed via fun ref state(): WidgetState. The Widget and CompositeWidget traits use this to provide default implementations without requiring seven boilerplate accessors.

class ref WidgetState

Constructors

create

[Source]

new ref create(
  parent': WidgetParent tag)
: WidgetState ref^

Parameters

Returns


Public fields

let parent: WidgetParent tag

[Source]


var width: USize val

[Source]


var height: USize val

[Source]


let child_grids: Array[(Any tag , Grid val)] ref

[Source]


var dirty: Bool val

[Source]


var debug_bg: (Default val | Black val | Red val | Green val | Yellow val | Blue val | Magenta val | Cyan val | White val | BrightBlack val | BrightRed val | BrightGreen val | BrightYellow val | BrightBlue val | BrightMagenta val | BrightCyan val | BrightWhite val | Rainbow val)

[Source]


Public Functions

empty_cell

[Source]

Return the empty cell for this widget. Uses debug_bg as background when set, making the widget's allocated space visible.

fun box empty_cell()
: Cell val

Returns