
20
The Notifier
In this chapter, we look at the Notifier in greater detail, discussing its role in processing
events for an XView application. This chapter serves as an introduction to the Notifier and
covers its use for most applications. You should be familiar with the topics covered in Chap-
ter 6, Handling Input, before you read this chapter.
20.1 Basic Concepts
The Notifier maintains the flow of control in an application. To understand the basic con-
cepts of the Notifier, we must distinguish between two different styles of input handling,
mainline and event-driven input, and consider how they affect where the flow of control
resides within a program.
20.1.1 Mainline Input Handling
The traditional type of input handling of most text-based applications is mainline-based and
input-driven. The flow of control resides in the main routine and the program blocks when it
expects input. That is to say, no other portion of the program may be executed while the pro-
gram is waiting for input. For example, in a mainline-driven application, a C programmer
will use fgets() or getchar() to wait for characters that the user types. Based on the
user’s input, the program chooses an action to take. Sometimes, that action requires more
input, so the application calls getchar() again. The program does not return to the main
routine until the processing for the current input is done.
The tight control represented by ...