Creating all the dialogs your application uses when you start the application is inefficient. The dialogs, which might or might not be displayed, take time to create, consume memory, and tie up server resources. If an application does not create a dialog until necessary, the application is smaller and has faster initial startup time. However, depending on the performance of the system, an unacceptable delay in posting each dialog might occur because the application must create a new dialog for each message.
ViewKit's compromise is to cache dialogs upon creation. When a particular dialog is no longer required, the application unmanages that dialog but retains in cache. If the cache contains an unused dialog widget when the application needs to post a dialog, the application reuses the cached dialog widget; otherwise, it creates a new dialog widget. ViewKit ObjectPak caches up to one dialog of each class for each window in the application (for example, information dialogs and question dialogs are cached separately).
Dialog class features
ViewKit ObjectPak dialog classes also offer the following features:
- Single function mechanisms for posting dialogs
- Ability to post any dialog in non-blocking, non-modal mode; modal mode; and two blocking modes
- Positioning in multi-window applications
- Posting of dialogs even when windows are iconified, if desired
- Correct handling of dialog references when widgets are destroyed