Bambookit Home    Bambookit GUI Tutorial

Next   

III. Event-Handling

Chapter 11. Events




Action


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



Examples

An action is a higher level event abstraction. It is triggered by different lower level events.

The button gets the action Event invoked when a mouse released event occurs WHILE the mouse is still within the boundaries of the button control
OR
it is invoked on a key released event WHILE the button still is in focus.

To demostrate the action event we will create a clear an Edit control.



<Widget setShape="0,0,100,80">
<Edit setShape="10,10,80,25" setName="name" addActionTarget="name,action,clearLabel=''"/>
<Button setShape="10,40,80,25" setLabel="Clear" addActionTarget="name,action,clearLabel=''"/>
</Widget>

The Edit widget, 'name', will clear its text
The Button widget will clear the Edit 'name's text



Next