Instance Property

becomesKeyOnlyIfNeeded

A Boolean value that indicates whether the receiver becomes the key window only when needed.

Declaration

@property BOOL becomesKeyOnlyIfNeeded;

Discussion

The value of this property is YES when the panel becomes the key window only when keyboard input is required; the value is NO when the panel becomes key when it’s clicked. The default value is NO.

This behavior is not set by default. You should consider setting it only if most user interface elements in the panel aren’t text fields, and if the choices that can be made by entering text can also be made in another way (such as by clicking an item in a list).

If the panel is a non-activating panel, then it becomes key only if the hit view returns YES from needsPanelToBecomeKey. This way, a non-activating panel can control whether it takes keyboard focus.

See Also

Configuring Panels

floatingPanel

A Boolean value that indicates whether the receiver is a floating panel.

worksWhenModal

A Boolean value that indicates whether the panel receives keyboard and mouse events even when some other window is being run modally.