methods-events-attributes-$12.lzx
<canvas width="100%" debug="true">
<class name="myclass_with_handler">
<event name="myevent"/>
<handler name="myevent" args="myargs">
Debug.debug("%#w handling myevent, myargs = %w", this, myargs);
</handler>
<attribute name="season" type="string" value="spring
"/>
<event name="onseason"/>
<handler name="onseason" args="s">
Debug.debug("got season of %w, season is %w", s, season);
</handler>
</class>
<myclass_with_handler id="foo"/>
<simplelayout axis="x" spacing="5"/>
<button onclick="foo.myevent.sendEvent(12)" text="send the event"/>
<button onclick="foo.setAttribute('season', 'fall')" text="autumn"/>
<button onclick="foo.season='winter'" text="evil"/>
</canvas>
Cross References
Classes
Named Instances
- <myclass_with_handler id="foo">