Bambookit Home    Bambookit GUI Tutorial

Back    Next   

III. Event-Handling

Chapter 11. Events


Quick Reference Guide

Method signature

addActionTarget = "[String] widget name, [Constant] event,[Method] execute method"
[String] is the name of the widget
[Constant] the event to listen on
[Method] the method signature


An unselected event occurs when any widget is loses its 'selection' bar, this is mostly used in conjunction with a listbox however it can also apply to sticky buttons as well.

To demostrate the unselected event we will create a popup on the selected event on the 'Click me' Item and a popdown on the unselected event on the 'Click me' Item

<Widget setShape="0,0,100,80">
<Widget setShape="10,5,80,25" setLabel="Popup" setName="popup" setBorder="flat" setVisible="false"/>
<Listbox setShape="10,35,80,40">
<Item setLabel="Click me" addActionTarget="popup,selected,setVisible='true',popup,unselected,setVisible='false'"/>
<Item setLabel="Other"/>

The Widget, 'popup', will execute the method 'setVisible'
On the selected event we execute popup.setVisible="true", the Widget Pops up
On the unselected event we execute popup.setVisible="false", the Widget Pops down
To handle more than one event, we append them to the addActionTarget, the addActionTarget accepts parameters in tuples (3,6,9,etc...)

Back    Next