Copyright ã1996 by NeXT Software, Inc.  All Rights Reserved.

;ManagingImages.rtfd;;¬  Next Section	;SettingButtonAttributes.rtfd;;¬  Previous Section

Associatingimageswithbuttons;¬Associating images or sounds with buttons

¬	Drag the icon representing an imageor sound from the nib file window or the Workspace and drop it over a button.

Or

¬	Enter the file name of the imageor sound in the appropriate field of the button's Attributes inspector.

When you click a button that has a sound associated with it, it plays the sound. Images appear in buttons with or without text. 

¬

When you drag an image or sound from the File Viewer, it automatically gets added to the Images or Sounds section of the nib file. 

¬

Several fields and controls in the Inspector's Attributes display for buttons relate to images and sounds. 

¬

Note that the name of an imageor sound in this display is the file name (find.tiff and Poit.snd, for example) minus the extension. Instead of dragging and dropping image and sound icons, you can type their file names (minus the extension) in the appropriate field. 

Before you type in the file name, you should insert the resource into the nib file or the project. Usually, you want to add the resource to the project. See ªManaging images and soundsº for more information.  ;ManagingImages.rtfd;;¬

Icon Position and Pixels Inset

The six buttons in the Icon Position group position the button title and icon relative to each other. Thus, you can have the title above, below, to the left, or to the right of the icon, or show only one or the other. The Pixels Inset pop-up list gives several pixel distances for adjusting the spacing between the icon and the nearest edge of the button.

Tip: If you want to import images into your interface for decorative purposes, use the image view object on the DataViews palette. You simply drop the image on the image view. You'll probably want to deselect the bordered option and the Editable option in the image view's Attributes inspector.