Bambookit Home    Bambookit GUI Tutorial

Back    Next   

III. Event-Handling

Chapter 11. Events




Drag and Drop


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

A 'dragdrop' event is triggered upon successfully dropping a 'draggable' widget into a 'droppable' container. Only widgets that are drop targets will generate this event

Below is a demonstration of the dragdrop event.



<Widget setShape="0,0,100,80">
<Widget setShape="10,10,80,25" setLabel="Popup" setName="popup" setBorder="flat" setVisible="false"/>
<Button setShape="5,40,20,25" setDrag="true"/>
<Button setShape="30,40,65,25" setDropTarget="1" setLabel="Drop Here" addActionTarget="popup,dragdrop,setVisible='true',popup,action,setVisible='false',this,action,setLabel='Drop Here'"/>
</Widget>



Back    Next