Important: The information in this document is obsolete and should not be used for new development.
NewDialog
To create a dialog box, you can use theNewDialog
function, which returns a pointer to a black-and-white graphics port (although system software draws the window frame of the dialog box using the system's default window colors). Generally, you should instead useGetNewDialog
to create a dialog box;GetNewDialog
takes information about the dialog from a dialog resource in a resource file. (Like window resources, dialog resources isolate descriptive information from your application code for ease of modification or translation to other languages.)The
NewDialog
function is identical to theNewColorDialog
function, except thatNewDialog
returns a pointer to a black-and-white graphics port. See the discussion
ofNewColorDialog
on page 6-108 for descriptions of the parameters that you also
pass toNewDialog
.
FUNCTION NewDialog (dStorage: Ptr; boundsRect: Rect; title: Str255; visible: Boolean; procID: Integer; behind: WindowPtr; goAwayFlag: Boolean; refCon: LongInt; items: Handle): DialogPtr;DESCRIPTION
TheNewDialog
function creates a dialog box as specified by its parameters and returns a pointer to a black-and-white graphics port for the new dialog box. The first eight parameters (dStorage
throughrefCon
) are passed to the Window Manager functionNewWindow
, which creates the dialog box.When specifying the size and position of the dialog box in the
boundsRect
parameter, you should generally try to center dialog boxes between the left and right margins of the screen or the window where the user is working, whichever is more appropriate. Also ensure that the tops of dialog boxes (including the title bars of modeless and movable modal dialog boxes) lie below the menu bar when you position them on the main screen. You can use the Menu Manager functionGetMBarHeight
to determine the height of the menu bar.SEE ALSO
If you use a dialog color table resource to change the default window colors, use theNewColorDialog
function, which returns a pointer to a color graphics port. See the description ofNewColorDialog
on page 6-108 for additional information common to both theNewDialog
andNewColorDialog
functions.