The Dock

The Mac OS X Dock replaces the Mac OS 9 Application menu. Always available (though it may be temporarily hidden), the Dock is designed to reduce on-screen disorder and help users organize their work. The Dock always contains the Finder icon and the Trash icon in the first and last positions, respectively, as shown in Figure 1-15. The Dock can also contain any number of additional icons that fall into four groups: running applications, minimized documents, file/folder icons, and application icons for commonly used applications (running or not) such as Mail, iTunes, and Internet Explorer. Every open application’s icon and every minimized document icon (for non-hidden applications) is in the Dock. The commonly used applications that populate the Dock are the choice of the user.

The Dock (bottom) location and appearance can be controlled via the Dock submenu

Figure 1-15. The Dock (bottom) location and appearance can be controlled via the Dock submenu

By choosing a menu command from the Dock submenu located in the Apple menu (see the top of Figure 1-15), a user can turn magnification and hiding on or off. When turned on, the magnification feature causes each icon in the Dock to enlarge when the mouse is positioned over it. When turned on, the hidden feature causes the Dock to “hide” off-screen unless the mouse is positioned over it. Users can also position the Dock as a whole at the left, right, or bottom of the screen. We prefer the Dock on the left or right side of the screen because most documents are portrait-shaped, and a Dock at the bottom of the screen gets in the way.

Users can access additional Dock preferences through the System Preferences application. We’ll experiment with those preferences in the step-by-step exercises later in this chapter.

The example Dock in Figure 1-15 contains 15 icons, 6 of which represent running applications (indicated by a black triangle below each icon). The first icon on the left is the Finder, which is always running. The second icon from the left is the running Mac OS X Mail application, which sports a “live” badge with the number of unread mail messages. The last three icons on the right are separated from the others by a slight gap with a barely visible line. This part of the Dock contains minimized document windows and is where the user can place file and folder icons from the Finder for quick access. The user’s Library folder icon is second from the right, and a minimized TextEdit document is third from the right. Minimized document icons are actually miniature versions of the windows they represent — great feedback for the user.

All the icons in the Dock provide a name when the mouse is positioned over them, as with the iTunes application at the left in Figure 1-16. When the mouse is pressed and held down on a Dock icon, a menu appears, as shown in the screen shot in the center of Figure 1-16.

Mouse positioned over (left) and pressed on (center) the iTunes icon; mouse pressed on the TextEdit icon (right)

Figure 1-16. Mouse positioned over (left) and pressed on (center) the iTunes icon; mouse pressed on the TextEdit icon (right)

If the Dock icon over which the mouse is pressed and held down represents an inactive application, the Show In Finder command is the only menu item available. If chosen, this menu command activates the Finder and selects the application, folder, etc. in the filesystem. If the application is active (i.e., running) when the mouse is pressed, the application icon in the Dock will display a special Dock menu containing Show In Finder and several other useful commands for quick access, as follows:

  • At the top of the Dock menu associated with an active application is a list of each of the application’s document windows; selecting one of these menu items brings the corresponding window to the front of the desktop. For example, the Dock menu for the running TextEdit application at the right in Figure 1-16 shows Doc 1 and Doc 2.

  • At the bottom of the Dock menu is a menu option labeled Quit. Selecting this option terminates the application.

  • If the application was not in the Dock prior to its being run, the menu option Keep In Dock will appear as well. Choosing this menu option causes the application’s icon to remain in the Dock after it is terminated.

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.