Implementing the About Panel in MathPaper
In this section, we’ll start implementing the animated About panel that we discussed earlier in the MathPaper application. The first thing we’ll do is to add a new module for the About panel’s nib file and arrange for the nib to be loaded automatically the first time the user chooses the MathPaper → About MathPaper menu command. (Recall that it’s more efficient to use a separate nib module for an About panel, as we did in our four-function Calculator in Chapter 6. Then the nib needs to be loaded into memory only if it’s used, and About panels aren’t used very often.)
Open
MathPaper.pbproj
in Project Builder.Double-click on
MainMenu.nib
in the Groups & Files pane of PB’s main window to open this nib file in IB.Choose IB’s File → New menu command, select Cocoa → Empty in the Starting Point panel, and then click the New button.
Choose IB’s File → Save menu command and save the new nib with the name
AboutPanel.nib
in your~/MathPaper/English.lproj
folder (not the~/MathPaper
folder). When prompted, add this file to the MathPaper project, as shown in Figure 14-2.
Figure 14-2. Adding AboutPanel.nib to the MathPaper project
Note that the File’s Owner of the
MainMenu.nib
file is an instance of the
NSApplication class (to see this in IB, click
MainMenu.nib
’s
File’s Owner icon and type Command-1). Also note
that by default, the MathPaper → About MathPaper ...
Get Building Cocoa Applications: A Step by Step Guide 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.