API Reference
Class
LiveWidget
Base class for widgets that accept live updates. State is mutated only through LiveWidget.Apply, which a live session calls on its render thread; typed handles post events from any thread.
Inheritance
- Object
- LiveWidget
Methods
public abstract Void Apply(LiveEvent liveEvent) #Returns:
VoidApplies an event to the widget's state.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event.
public virtual String? Describe(LiveEvent liveEvent) #Returns:
String?Returns a line describing the event for line-based outputs (Stream/Plain), or null when the event is not worth a line (for example a single counter increment). Called after ILiveTarget.Apply.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event that was applied.
Returns
A plain line or null.
public abstract Size Measure(Constraints constraints, RenderContext context) #Returns:
SizeReturns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Returns
The desired size, never larger than the constraints.
public abstract Void Render(Region region, RenderContext context) #Returns:
VoidRenders into a region. The region may be smaller or larger than the measured size.
Parameters
- region ConsoleMonster.Canvas.Region
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?