Changing Calculator’s Application Icon

To show you how to change the application icon for our Calculator, we’ll assume that you’ve saved a copy of the file AppIcon.icns in your ~/Calculator folder as we described in the previous section. (If you haven’t done this, copy the file with this name from /Developer/Examples/AppKit/DotView or some other AppKit example). Then we’ll tell PB to use an image from AppIcon.icns for our Calculator’s application icon. When the Calculator program is compiled, the icon’s image will automatically be included in the Calculator’s NSBundle folder.

  1. Back in PB with Calculator.pbproj, choose Project Add Files.

  2. Select the AppIcon.icns file, as shown in Figure 6-21, and click the Open button.

Adding the AppIcon.icns file to the Calculator project

Figure 6-21. Adding the AppIcon.icns file to the Calculator project

As shown in Figure 6-22, PB will prompt you as to whether or not you wish to copy the items that you have just selected (e.g., the AppIcon.icns file) into the destination group’s folder. The setting of this checkbox does not matter, because you already copied the AppIcon.icns file into your project directory.

Option to copy AppIcon.icns into project directory

Figure 6-22. Option to copy AppIcon.icns into project directory

  1. Do not change any settings in the newly dropped sheet; simply click the Add button.

The AppIcon.icns file should now show up in the Groups ...

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.