Sending custom notifications

The example in the previous section used standard notifications to inform TShapeView of changes to TShapeList. As a result, TShapeView is only able to respond by invalidating the entire view.

The following example extends the previous one by deriving a new notification class to carry additional information. The class, TShapeNotification, will contain a copy of the shape that was added or removed. TShapeView uses this additional information to invalidate only this area.

NOTE A copy of the shape is passed, rather than a pointer, because the semantics of TNotification require that notifications are capable of streaming across address spaces.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker