O'Reilly logo

Cocoa® Programming for Mac OS® X For Dummies® by Erick Tejkowski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. A Window with a View

In This Chapter

  • Opening, closing, and hiding windows

  • Positioning windows anywhere on the screen

  • Tracking open windows

  • Changing the appearance of windows

  • Resizing windows

  • Seeing through a window

  • Using sheets and delegates

Perhaps the most important element of any GUI-based application is the window. In fact, the window is so important that those guys from Redmond used it to name their operating system. The windows in an application are like pieces of paper that you use to collect ideas, display information, and record input.

Windows in Cocoa are equally important. Mac OS X continues using the fine window traditions that made the Mac OS famous, but Cocoa builds on and improves those ideas from the past with exciting new features. In this chapter, you examine some of the most common window features of Cocoa applications. In the process, you create two projects that demonstrate these features.

Working with Windows

Because windows form the basis for nearly all interfaces, you'll use them often as part of your projects. Some of the most common functions that you'll perform include

  • Opening and closing windows

  • Moving windows

  • Adding windows to the Windows menu

In the following sections, you discover how to accomplish all these tasks and more.

Opening and closing a window

When you work with windows in your Cocoa projects, you'll often use Interface Builder to design them. Further, if you leave a window open in Interface Builder when you're designing an interface for an application, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required