Important: The information in this document is obsolete and should not be used for new development.
CloseDialog
To dismiss a dialog box for whose dialog record you allocated memory, use theCloseDialog
procedure.
PROCEDURE CloseDialog (theDialog: DialogPtr);
theDialog
- A pointer to a dialog record.
DESCRIPTION
TheCloseDialog
procedure removes a dialog box from the screen and deletes it from the window list. TheCloseDialog
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
- the data structures associated with the dialog box (such as its structure, content, and update regions)
- all the items in the dialog box (except for pictures and icons, which might be shared by other resources) and any data structures associated with them
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. UnlikeGetNewDialog
,NewColorDialog
does not use a copy of the item list resource. Thus, if you
useNewColorDialog
to create a dialog box, you may want to useCloseDialog
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 passingNIL
in thedStorage
parameter to theGetNewDialog
,NewColorDialog
, orNewDialog
function), use theDisposeDialog
procedure, described next, instead ofCloseDialog
.