By using dispatch figures, it is possible to specify that rules in a
certain scope be used to process specific event figures. To associate
an event figure to a certain scope, two dispatch figures must go from
each end of the drag event figure to a third dispatch figure. The
third dispatch figure is linked to some scope figure, either directly
or through a chain of dispatch figures. For click event figures, a
simple chain of dispatch figures can be used to connect the click
event figure to the scope figure that should process it.
For example, the Vispatch program below demonstrates this technique
for two of the drag event figures. This causes the program to process
events in two different ways. The lower scope figure draws a fractal tree
starting at the event location. The upper scope figure draws a spiral
starting at the event location. By having the upper scope figure
process one of the events in the tree-drawing rule, a spiral is
created for every branch in the tree.
|