| When the user clicks or drags a mouse
(when in event mode), an event is generated. Events focus
processing to a certain part of the document. Two types of figures determine which figures will be the "program" that processes the event. The first is the scope figure, which looks like a rectangle with a thin shadow on its right and bottom edge. The second is the dispatch figure, which looks like a thick outlined arrow. Scope figures and dispatch figures work as follows: If an event (a mouse drag or a mouse click) is issued that ends in a scope figure that is connected to a second scope figure via a series of one or more dispatch figure(s), the figures inside the second scope figure will serve as the program that processes the event. The connection must go from the lower-right of the first scope figure to the upper-left of the second. This works more simply than it sounds, as illustrated by the three examples in the applet below: |
|
Try experimenting with mouse drags that start outside a scope
and end inside it. Notice it is where the event ends
that determines which figures will process it.
By performing long mouse drags, you can also demonstrate that Vispatch programs can create figures that go outside of the scope figure that contains the original event. You can also try using the applet's drawing features to draw a dispatch arrow from the lower-right corner of the bottom scope figure to the upper-left corner of the "star" scope figure. After doing so, the bottom scope figure should start producing stars in response to mouse drags. |