![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Dock Icon ExampleDownload Example Project(140K) This example shows how to alter Dock icon of a FaceSpan application while it's running. You can use your application's Dock icon to indicate the state of your application, the progress of long-running operations, or to indicate errors. Preparing IconsApplication and Dock icons are expected to be 128x128 pixels in size. You can use any image format (JPEG, GIF, PNG, TIFF, icns) for your image. Since the Dock floats over other content on your screen, Dock icons should have a transparent background. For this example, we are using the following icons:
Once you've created your icons, add them to the Images section of your FaceSpan project:
Controlling the Dock IconThe FaceSpan application object provides access to the application's Dock icon through the icon image property. Setting this property instantly alters the icon displayed for your application in the Dock. For this example, we have a window with a series of radio buttons to select the Dock icon to present. We also have an image view in the window to show a preview of the current Dock icon.
We then attach the following code to the matrix of radio buttons: property pAppIcon : missing value The awake from nib handler caches references to the images we'll be using for the Dock icon. The clicked handler responds to changes in the radio buttons. This code does two things:
This QuickTime movie shows how the Dock responds when this application runs:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||