Initialize. Run taskmaster.
Record x,y position and type of event in mouseEvent. Put mouseEvent on EventQueue.
Repeat Forever
Call ProcessEvent for GUI.
Execute next task.
Get next event from eventQueue and call it anEvent.
Determine which widget was clicked on.
If widget is a pushbutton and
a buttonPress is followed by a buttonRelease then
Put task "activate anEvent" for widget on task Queue.
else
Put task (event_name _ " anEvent") for widget on taskQueue.
Find the manager of the dialogbox which owns me. Send "activate anEvent" to manager.
Run my "eraseActivate" method (if it exists).
erase the window associated with me.
Find the manager of the dialogbox which owns me. Send "buttonPress anEvent" to manager.
Send "buttonPress anEvent" to its form. Send "buttonPress anEvent" to its action.
Note time of buttonPress.
If time is < 300 ms then
execute double-click method.
else
execute single-click method.
Find the figure containing coordinates of anEvent. Send "buttonPress anEvent" to the figure.