Starting with Dialogs
Volume Number: 9
Issue Number: 3
Column Tag: Getting Started
Related Info: Dialog Manager
Having a Dialog with Your Mac
Dialogs and alerts via the Macintosh Dialog Manager
By Dave Mark, MacTech Magazine Regular Contributing Author
Note: Source code files accompanying article are located on MacTech CD-ROM or
source code disks.
In last month’s column, we explored the inner workings of the Menu Manager.
This month, we’ll build on that experience and create a program with menus, windows,
and, for the first time, dialogs and alerts. Since this program is the biggest one we’ve
tackled so far, we’ll break our work down into two parts. This month, we’ll create the
resources we’ll need, type in the source code, then take ‘er out for a spin. Next month,
we’ll get into the details of the Dialog Manager and explore the elements that make the
program work.
Creating the Dialogger Resources
We’ll start off just as we did in last month’s column, by creating our MBAR and
MENU resources. Create a folder inside your Development folder named Dialogger .
Next, launch ResEdit and create a new file called Dialogger.π.rsrc inside this new
folder.
Now select Create New Resource from the Resource menu and create a new MBAR
resource according to the specifications in Figure 1. As you can see, our program will
feature three differents menus.
Figure 1. Specifications for Dialogger’s MBAR resource.
Close the MBAR and MBAR picker windows and again select Create New Resource
from the Resource menu. Create a MENU resource according to the specifications in
Figure 2. This MENU represents the [Missing image]u. Be sure that the MENU’s resource id is
128.
Figure 2. Specifications for the [Missing image]NU resource.
Now create another MENU resource according to the specifications shown in