Expand description
Event handlers in a screen’s code-behind — what double-clicking a button
in Visual Studio’s designer does: foo.yui’s on_click="play" gets an
events::PLAY => play(), arm in the match over click(event) in
foo.rs and an empty fn play(), and the editor opens there. An
existing arm is just navigated to. A missing foo.rs is created with the
usual skeleton (ui_include!, on_event, register).
Structs§
- Handler
Location - Where the editor should go.
Functions§
- add_
handler - Adds (or finds) the handler for
eventinsrc;Nonewhen there’s no eventmatchto add an arm to. Returns the new text and the 1-based line/column of the handler’s body (or the existing arm). - code_
behind_ path foo.yui→foo.rsbeside it.- const_
name - The
events::constant for an event name (yog-cli’sconst_name). - ensure_
handler - Makes sure
yui’s code-behind handlesevent, writing the file when needed; where to put the caret. - handler_
name - A Rust fn name for an event:
play,mymod:btn-play→mymod_btn_play.