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 / Handling Events in Dialog Boxes


IsDialogEvent

To determine whether a modeless dialog box or a movable modal dialog box is active when an event occurs, you can use the IsDialogEvent function.

FUNCTION IsDialogEvent (theEvent: EventRecord): Boolean;
theEvent
An event record returned by an Event Manager function such as WaitNextEvent.
DESCRIPTION
If any event, including a null event, occurs when your dialog box is active, IsDialogEvent returns TRUE; otherwise, it returns FALSE. When IsDialogEvent returns FALSE, pass the event to the rest of your event-handling code. When IsDialogEvent returns TRUE, pass the event to DialogSelect after testing for the events that DialogSelect does not handle.

A dialog record includes a window record. When you use the GetNewDialog, NewDialog, or NewColorDialog function to create a dialog box, the Dialog Manager sets the windowKind field in the window record to dialogKind. To determine whether the active window is a dialog box, IsDialogEvent checks the windowKind field.

Before passing the event to DialogSelect, you should perform the following tests whenever IsDialogEvent returns TRUE:

If your application uses IsDialogEvent to help handle events when you display a movable modal dialog box, perform the following additional tests before passing events to DialogSelect:

SPECIAL CONSIDERATIONS
Both IsDialogEvent and DialogSelect are unreliable when running in versions of system software earlier than System 7. You shouldn't use these routines if you expect your application to run in earlier versions of system software.

SEE ALSO
The WaitNextEvent function is described in the chapter "Event Manager" in this book. See Inside Macintosh: Sound for a description of the SysBeep procedure. The FrontWindow function is described in the chapter "Window Manager" in this book.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996