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:
Open the nib file.
Add an item from the Enhanced Controls palette.
Add items from the Controls palette.
Add a PICT resource to the project.
Align objects.
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:
If it is not already open, open the Moon Travel Planner project.
Double-click
main.nib
in the Resources group in the project window.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.
Choose Palettes from the Palettes submenu in the Tools menu.
Click the Enhanced Controls button in the palette toolbar.
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.