< Previous PageNext Page > Hide TOC

NSMenuItem Bindings

Related class
Availability
Available in Mac OS X v10.3 and later.

Contents:

Availability Bindings
Parameters Bindings
Value Bindings


Availability Bindings

enabled

A multiple-value binding that determines if the NSMenuItem is enabled in the user interface.

When enabled is bound, a new binding, enabled2, is exposed and can be bound. Binding to enabled2 causes enabled3 to be exposed, and so on.

The NSMenuItem is enabled if a logical AND operation on all the enabled bindings results in a Boolean value of YES.

Availability:
Available in Mac OS X v10.3 and later.
Binding is Read-Only.


Binding Options
OptionBinding option constantValue class
Raises for Not Applicable KeysNSRaisesForNotApplicableKeysBindingOptionNSNumber (Boolean)


Placeholders
DescriptionPlaceholder constantValue class
Multiple Values PlaceholderNSMultipleValuesPlaceholderBindingOptionNSNumber (Boolean) or NSNull
No Selection PlaceholderNSNoSelectionPlaceholderBindingOptionNSNumber (Boolean) or NSNull
Not Applicable PlaceholderNSNotApplicablePlaceholderBindingOptionNSNumber (Boolean) or NSNull
Null PlaceholderNSNullPlaceholderBindingOptionNSNumber (Boolean) or NSNull

Parameters Bindings

image

An NSImage that specifies the image displayed by the NSMenuItem.

Availability:
Available in Mac OS X v10.3 and later.
Binding is Read-Only.


Binding Options
OptionBinding option constantValue class
Raises for Not Applicable KeysNSRaisesForNotApplicableKeysBindingOptionNSNumber (Boolean)

mixedStateImage

An NSImage that is displayed when the value of the NSMenuItem is NSMixedState.

The default image is an en dash.

Availability:
Available in Mac OS X v10.3 and later.
Binding is Read-Only.


Binding Options
OptionBinding option constantValue class
Raises for Not Applicable KeysNSRaisesForNotApplicableKeysBindingOptionNSNumber (Boolean)

offStateImage

An NSImage that is displayed when the value of the NSMenuItem is NSOffState.

The default is an empty image.

Availability:
Available in Mac OS X v10.3 and later.
Binding is Read-Only.


Binding Options
OptionBinding option constantValue class
Raises for Not Applicable KeysNSRaisesForNotApplicableKeysBindingOptionNSNumber (Boolean)

onStateImage

An NSImage that is displayed when the value of the NSMenuItem is NSOnStatem.

The default image is a checkmark.

Availability:
Available in Mac OS X v10.3 and later.
Binding is Read-Only.


Binding Options
OptionBinding option constantValue class
Raises for Not Applicable KeysNSRaisesForNotApplicableKeysBindingOptionNSNumber (Boolean)

title

An NSString value that is displayed as the label of the NSMenuItem.

Availability:
Available in Mac OS X v10.3 and later.
Binding is Read-Only.


Binding Options
OptionBinding option constantValue class
Raises for Not Applicable KeysNSRaisesForNotApplicableKeysBindingOptionNSNumber (Boolean)


Placeholders
DescriptionPlaceholder constantValue class
Multiple Values PlaceholderNSMultipleValuesPlaceholderBindingOptionNSString
No Selection PlaceholderNSNoSelectionPlaceholderBindingOptionNSString
Not Applicable PlaceholderNSNotApplicablePlaceholderBindingOptionNSString
Null PlaceholderNSNullPlaceholderBindingOptionNSString

Value Bindings

value

An integer value that specifies the state of the NSMenuItem.

If value evaluates to 0 (NSOffState) or nil, the off state image is displayed; the default is an empty image. If value evaluates to 1 (NSOnState), the on state image is displayed; the default is a checkmark. If value evaluates to -1 (NSMixedState), the mixed state image is displayed, the default is an en dash.

Availability:
Available in Mac OS X v10.3 and later.


Binding Options
OptionBinding option constantValue class
Allows Editing Multiple Value SelectionNSAllowsEditingMultipleValuesSelectionBindingOptionNSNumber (Boolean)
Always Presents Application Modal Alerts. Available in Mac OS X v10.4 and later.NSAlwaysPresentsApplicationModalAlertsBindingOptionNSNumber (Boolean)
Conditionally Sets EnabledNSConditionallySetsEnabledBindingOptionNSNumber (Boolean)
Raises for Not Applicable KeysNSRaisesForNotApplicableKeysBindingOptionNSNumber (Boolean)
Validates ImmediatelyNSValidatesImmediatelyBindingOptionNSNumber (Boolean)



< Previous PageNext Page > Hide TOC


© 2004, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-10-31)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.