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 / Manipulating Items in Alert and Dialog Boxes


HideDialogItem

Although you should rarely need to do so, you can make an item in a dialog box invisible by using the HideDialogItem procedure. The HideDialogItem procedure is also available as the HideDItem procedure.

PROCEDURE HideDialogItem (theDialog: DialogPtr; itemNo: Integer);
theDialog
A pointer to a dialog record.
itemNo
A number corresponding to the position of an item in the dialog box's item list resource.
DESCRIPTION
The HideDialogItem procedure hides the item specified by itemNo by giving it a display rectangle that's off the screen. Specifically, if the left coordinate of the item's display rectangle is less than 8192 (hexadecimal $2000), HideDialogItem adds 16,384 (hexadecimal $4000) to both the left and right coordinates of the rectangle. If the item is already hidden (that is, if the left coordinate is greater than 8192), HideDialogItem does nothing. To redisplay an item that's been hidden by HideDialogItem, you can use the ShowDialogItem procedure.

SPECIAL CONSIDERATIONS
If your application needs to display a number of dialog boxes that are similar except for one or two items, it's generally easier to modify the common elements using the AppendDITL and ShortenDITL procedures than to use the HideDialogItem and ShowDialogItem procedures.

The rectangle for a static text item must always be at least as wide as the first character of the text.

You generally shouldn't use HideDialogItem to make an editable text item invisible, because as the user presses the Tab key, the Dialog Manager attempts to move the cursor to the hidden editable text item, where the user's subsequent keystrokes will be placed.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996