Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Macintosh Toolbox Essentials /
Chapter 6 - Dialog Manager / Dialog Manager Reference
Dialog Manager Routines / Creating and Disposing of Dialog Boxes


CloseDialog

To dismiss a dialog box for whose dialog record you allocated memory, use the CloseDialog procedure.

PROCEDURE CloseDialog (theDialog: DialogPtr);
theDialog
A pointer to a dialog record.
DESCRIPTION
The CloseDialog procedure removes a dialog box from the screen and deletes it from the window list. The CloseDialog procedure releases the memory occupied by

Generally, you should provide memory for the dialog record of modeless dialog boxes when you create them. (You can let the Dialog Manager provide memory for modal and movable modal dialog boxes.) You should then use CloseDialog to close a modeless dialog box when the user clicks the close box or chooses Close from the File menu.

Because CloseDialog does not dispose of the dialog resource or the item list
resource, it is important to make these resources purgeable. Unlike GetNewDialog, NewColorDialog does not use a copy of the item list resource. Thus, if you
use NewColorDialog to create a dialog box, you may want to use CloseDialog to
keep the item list resource in memory even if you didn't supply a pointer to the memory.

SEE ALSO
If you let the Dialog Manager allocate memory for the dialog box (by passing NIL in the dStorage parameter to the GetNewDialog, NewColorDialog, or NewDialog function), use the DisposeDialog procedure, described next, instead of CloseDialog.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996