Receiving User Notifications

A user notification occurs when an event is triggered with an event type that is greater than or equal to User_Base_Event (16).

Non-GUI objects (that is, objects that are not instances of a Window subclass) respond to user notifications by implementing the Object class userNotification method.

GUI objects (that is, objects that are instances of a Window subclass) respond to user notifications by implementing their Window subclass userNotify event method.

The userNotification method has the following signature.

userNotification(eventType: Integer;
                 theObject: Object;
                 eventTag:  Integer;
                 userInfo:  Any) updating;

The userNotify method has the following signature.

userNotify([control:  Control-type input;] // parameter only for controls
           eventType: Integer;
           theObject: Object;
           eventTag:  Integer;
           userInfo:  Any) updating;

An exception is raised if the notification subscriber does not exist. To terminate the delivery of notifications to a subscriber, use the Object class endNotificationForSubscriber method to specify the subscriber whose previously registered Object class beginNotification, beginClassNotification, beginClassesNotification, beginClassNotificationForIF, beginClassesNotificationForIF, and beginNotificationForIF methods are to be terminated. (For details about terminating the delivery of notifications, see "Ending a Notification", later in this chapter.)

For examples of the userNotification and userNotify methods, see "User Notification Examples", later in this section.