API Reference
Slot
A named place in a layout whose widget can be replaced while a live session runs: put it anywhere (inside a panel, a column, a dashboard), then swap its content with LiveSession.Region or a SlotHandle. The swap goes through the session's update queue, so it is thread-safe and lands between frames; the surrounding frame stays and only the changed cells are redrawn. Live widgets inside the new content are registered with the session under their names, replacing widgets of the same name. Live operations: set (Payload = the new widget), clear.
Inheritance
- LiveWidget
- Slot
Constructors
public Slot(String name, IWidget? content = null) #Creates a slot.
Parameters
- name System.String
- The live name the slot is addressed by.
- content ConsoleMonster.Layout.IWidget? = null
- The first content, or null for an empty slot.
Methods
public override Void Apply(LiveEvent liveEvent) #VoidApplies an event to the widget's state.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event.
public SlotHandle Handle(ILiveDispatcher dispatcher) #SlotHandleA handle that replaces the content through a dispatcher (a live session).
Parameters
- dispatcher ConsoleMonster.Live.ILiveDispatcher
- The dispatcher.
Returns
The handle.
public override Size Measure(Constraints constraints, RenderContext context) #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 override Void Render(Region region, RenderContext context) #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.
public Void Set(IWidget? content) #VoidReplaces the content directly (not thread-safe; use a handle while a session runs).
Parameters
- content ConsoleMonster.Layout.IWidget?
- The new content, or null to empty the slot.
Inherited Methods
public virtual String? Describe(LiveEvent liveEvent) #String?Parameters
- liveEvent LiveEvent
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?