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

;AssociatingImagesWithButtons.rtfd;;¬  Next Section	;CustomizingWindowsAndPanels.rtfd;;¬  Previous Section

Settingbuttonattributes;¬Setting button attributes 

¬	Enter the button's main and alternate titles.

¬	Select the button type.

¬	Specify any key equivalent.

¬	Specify button options.

The Attributes display for buttons enables you to set a button's type, title, icon, alternate title and icon, and various other characteristics. The object labeled Button on the Views palette is only one style of button (albeit the most common style). The palette also holds radiobuttons and switch buttons. Using the Attributes display for buttons, you can customize any palette button, making it something that is uniquely suitable for a particular circumstance.

¬

The Icon Position and Pixels Inset controls as well as the Sound and Icon fields are described in detail in the next task, ªAssociating images or sounds with buttons.º  ;AssociatingImagesWithButtons.rtfd;;¬

For more information on the Tag field, see ªUsing tagsº in this chapter.  ;UsingTags.rtfd;;¬

Button Titles and Icons 

The Title field's value is what appears in most buttons; you can set the title by double-clicking inside the button. The Icon field identifies an image stored in the nib file (Images display) that appears within the button. The alternate title (Alt. Title) and the alternate icon (Alt. Icon) appear when the user clicks a button of type Momentary Change or Toggle. 

Button Key 

The Key field identifies a keyboard alternative to clicking the button. Possible values are: \e (Escape), \r (Return), and any normal letter or number.

Button Type

Type	Button Behavior When Clicked
¬

Momentary Push	Button is highlighted, appears to be pressed.
¬

Momentary Change	Alternate button title and icon appear (while mouse button is pressed).
¬

Momentary Light	Button is highlighted, but no illusion of being pressed.
¬

Push On/Push Off	First click highlights button with illusion of being pushed in; second click returns it to normal.
¬

On/Off	First click highlights button. Second click returns it to normal.
¬

Toggle	First click displays alternate title and button. Second click returns to normal.
¬

Button Options

Option	Description
¬

Bordered 	A line is drawn around the button's border.
¬

Transparent 	The button has no border, text, icon, or background color.
¬

Continuous	The button sends its action message continuously when pressed.
¬

Disabled 	Prevents activation of the button; title is in gray.
¬

Selected	The button, when initialized, is to be selected (applies to switchand radiobuttons).
¬

You might think of storing specially configured buttons on a dynamic palette. See Chapter 5, ªUsing Dynamic Palettes,º for complete information.  ;../05_DynamicPalettes/DynamicPalettes.rtfd;;¬

Related Concept:  ;SettingAttributesConcepts.rtfd; linkMarkername TheAnatomyofaButton;,  The Anatomy of a Button