Tool Trigger

Definition:

The Tool trigger is used to program an agent to respond to clicks with the worksheet tools.

The rules located in a method labeled with a Tool trigger are executed whenever the executing agent senses a click from the designated tool, whether the simulation is running or not.

Warning

Warning: If you redefine the Pencil, Eraser, and Arrow tools, you will overwrite system functionality as follows:

Pencil - You will be unable to select the agent that redefines it in the Gallery and add it to the worksheet. To add these agents, place them in the worksheet using the Draw Rectangle Tool.
Eraser - You will be unable to erase an agent that redefines it in the Worksheet.
Arrow - You will be unable to double-click to open the rule editor, or to move the agent that redefines it.

Parameters:

Tool

Example:

When the Pencil tool is used on the Cell agent in the Game of Life simulation, it toggles between the dead and alive depictions.

Game of Life Game of Life Game of Life

See the Game of Life simulation.


| Next | Previous | Reference Manual | Getting Started Manual |