Skip to content

Uicb

Stl.UICallbacks — LIBRARY

Import

import "_IVLS/std-library/nodes/components/uicb.ksp"

Node: Stl.UICallbacks

Uses: Init, UICBS

Overview

Stl.UICallbacks — LIBRARY

UI callback routing system component node.

  • Routes ui_control events to named callback functions without requiring direct widget references
  • Widgets are bound via uicb.Bind; uicb.delegate dispatches the registered callback with binding index
  • uicb.Fire allows programmatic triggering through a hidden stub slider
  • Callbacks registered in STL.UI_CALLBACKS must have signature (ui_id, n)
  • The Assignments 2D list encodes callback ID and binding index using the UICB.ASSIGN_SPACER stride

API

Nodes

Name Description
node Stl.UICallbacks UI callback routing node with widget binding, delegation, and programmatic firin...

Defines

Name Description
define STL.UI_CALLBACKS =+ NULL Extensible list of registered UI callback names; seeded with the NULL no-op.

Const Blocks

Name Description
const uicb.id Enumeration constant block assigning an integer ID to each registered UI callbac...

Macros

Name Description
uicb.Bind(#ui_id#, #uicb#) Binds a widget to a named UI callback so it is dispatched via uicb.delegate.
uicb.DelegateCaseID(#uicb#, #ui_id#, #n#) Emits a case branch that dispatches a single named UI callback.
uicb.Fire(#index#, #uicb#, #value#) Programmatically fires a named UI callback without a physical widget interaction.

Functions

Name Description
uicb.delegate(ui_id) Looks up the registered callback for a widget and invokes it.

Nodes

node Stl.UICallbacks

Callbacks: Init, UICBS

UI callback routing node with widget binding, delegation, and programmatic firing.


Defines

define STL.UI_CALLBACKS =+ NULL

Extensible list of registered UI callback names; seeded with the NULL no-op.


Const Blocks

const uicb.id

Enumeration constant block assigning an integer ID to each registered UI callback name.


Macros

uicb.Bind(#ui_id#, #uicb#)

Binds a widget to a named UI callback so it is dispatched via uicb.delegate.

Parameter Description
#ui_id# Name token of the widget to bind
#uicb# Name token of the callback to associate with the widget

uicb.DelegateCaseID(#uicb#, #ui_id#, #n#)

Emits a case branch that dispatches a single named UI callback.

Parameter Description
#uicb# Name token of the UI callback (must be registered in STL.UI_CALLBACKS)
#ui_id# Expression or variable holding the ui_id of the triggering widget
#n# Expression or variable holding the binding index

uicb.Fire(#index#, #uicb#, #value#)

Programmatically fires a named UI callback without a physical widget interaction.

Parameter Description
#index# Binding index passed as the n argument to the callback
#uicb# Name token of the callback to invoke
#value# Integer value to assign to the stub slider before the call

Functions

uicb.delegate(ui_id)

Looks up the registered callback for a widget and invokes it.

Parameter Type Description
ui_id integer The ui_id of the widget that triggered the event

Side effects:

Name Type Purpose
raw_idx integer Raw index returned by search() into the Assignments list
id integer Callback ID derived from the raw index
n integer Binding index derived from the raw index

Example

// TODO: Add usage example

See Also