Moon Travel Planner: Adding Objectsto the Main Window

In the last chapter, you set up the main window for the Moon Travel Planner application. Now, you’ll add objects to the main window so the window looks like the one we specified in Chapter 2. You’ll need to do the following:

  1. Open the nib file.

  2. Add an item from the Enhanced Controls palette.

  3. Add items from the Controls palette.

  4. Add a PICT resource to the project.

  5. Align objects.

  6. Check the interface.

Open the Nib File

As you did in the last chapter, you’ll open the nib file from the Moon Travel Planner project window:

  1. If it is not already open, open the Moon Travel Planner project.

  2. Double-click main.nib in the Resources group in the project window.

  3. In Interface Builder, double-click the MainWindow icon in the Instances pane.

Add an Item from the Enhanced Controls Palette

As you recall, our sketch of the main window in Chapter 2 shows a graphic image at the top of the window, so let’s start with that. To accomplish this, you’ll add one object from the Enhanced Controls palette—a PICT control. A PICT control is really just a container for an image; you use it to lay out the interface. Later, you’ll drag the image you want to appear in the interface on top of the PICT control.

  1. Choose Palettes from the Palettes submenu in the Tools menu.

  2. Click the Enhanced Controls button in the palette toolbar.

  3. Add a PICT control to the top center of the interface. This is a container for the image of the moon. Drag a PICT box from the Enhanced Controls palette ...

Get Learning Carbon now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.