struct

Tryst::UI::EventBinding

Inherits Struct < Value < Object

An event a node wants wired up. target is nil to bind on the node's own widget, or a Symbol naming another node's widget - resolved by the realizer's link pass, after every node in the whole tree has already been created, so a target declared later in the build still resolves correctly (the forward-reference case). subs are Tryst::App#bind substitution codes (e.g. [:x, :y]) forwarded to the handler when it fires.

handler's type mirrors App#bind's own block signature exactly (see TclArgValue's Proc member in app.cr) - an EventBinding's handler ultimately gets passed straight through to App#bind by the realizer.

Constructors

new(event : String, handler : Proc(Array(String), CallbackSignal, Nil), target : Symbol | Nil = nil, subs : Array(Symbol | String) = [] of Symbol | String)
Source

Instance methods

clone
Source
copy_with(event _event = @event, handler _handler = @handler, target _target = @target, subs _subs = @subs)
Source
event
handler
subs
target