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 / Initializing the Dialog Manager


SetDialogFont

Although you generally should not change the font used in static and editable text items, you can do so with the SetDialogFont procedure. The SetDialogFont procedure is also available as the SetDAFont procedure.

PROCEDURE SetDialogFont (fontNum: Integer);
fontNum
A font ID number. Do not rely on font number constants. Instead, use
the Font Manager function GetFNum to find the font number to pass in this parameter.
DESCRIPTION
For subsequently created dialog and alert boxes, SetDialogFont sets the font of the dialog or alert box's graphics port to the specified font. If you don't call this procedure, the system font is used. The SetDialogFont procedure does not affect titles of controls, which are always displayed in the system font.

SPECIAL CONSIDERATIONS
There are a number of caveats regarding the SetDialogFont procedure.

First, the Standard File Package does not always properly calculate the position of the standard file dialog box once this procedure has been called; for example, the standard file dialog box may be partially obscured by a menu bar. Second, be aware that this procedure affects all static text and editable text items in all of the alert and dialog boxes you subsequently display. Third, SetDialogFont does not change the font for control titles. Fourth, you can't use SetDialogFont to change the font size or font style. Finally, and most importantly, your application will be much easier to localize if you always use the system font in your alert and dialog boxes and never use SetDialogFont.

SEE ALSO
See the chapter "Font Manager" in Inside Macintosh: Text for information about the GetFNum function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996