He clicks button 2 in the word make which he's left in the tag of the window for his source directory. He selects it with button 1, and while holding button 1 down, clicks button 2 to cut out the offending parenthesis. He selects make in the tag of the window of the directory, and the cycle begins again. This whole interaction required six mouse clicks and much less time than the time to read about it. The events it waits for are keyboard and mouse actions, and output arriving on pipes shared with child processes.
Text display is handled by text widgets.
To execute a command that isn't built in, the wily server forks a child, modifies its execution environment, and exec s the required command. The current directory is set to that which the command was invoked from. The parent adds the file descriptors passed to the child to a list of file descriptors that it monitors for output, and remembers which directory that stream is associated with, so that output will appear in an appropriate window. More sophisticated client processes can communicate with the server through a message protocol. The message protocol is still being designed, but basically when the user interacts with a wily window, wily sends messages to the client program to let it know what the user has done.