Function

NSInterfaceStyleForKey

Returns an interface style value for the specified key and responder.

Declaration

NSInterfaceStyle NSInterfaceStyleForKey(NSString *key, NSResponder *responder);

Discussion

Used to determine an interface style based on a key and a responder, either of which may be nil. An NSInterfaceStyle value specifies the style in which an interface item, such as a button or a scroll bar, should be drawn. For example, a value of NSMacintoshInterfaceStyle indicates an item should be drawn in the Macintosh style. The values defined for NSInterfaceStyle are NSNoInterfaceStyle, NSNextStepInterfaceStyle, NSWindows95InterfaceStyle, and NSMacintoshInterfaceStyle. Note that this function never returns NSNoInterfaceStyle.

The interface style value returned by this function depends on several factors. If responder is not nil and if responder specifies an interface style other than NSNoInterfaceStyle, this function returns the responder’s style, and key is ignored.

Otherwise, if key is not nil and there is an interface style for key specified by the defaults system, this function returns the interface style for key from the defaults system.

Finally, if key is nil, or if there is no interface style for key specified by the defaults system, this function returns the global interface style specified by the defaults system.

The defaults system allows an application to customize its behavior to match a user’s preferences. You can read about the defaults system in the documentation for NSUserDefaults.

See Also

Auxiliary Functions

NSDrawColorTiledRects

Draws a colored bordered rectangle.

NSSetShowsServicesMenuItem

Specifies whether an item should be included in Services menus.

NSCopyBits

Copies a bitmap image to the location specified by a destination point.

Deprecated
NSCountWindows

Counts the number of onscreen windows.

Deprecated
NSCountWindowsForContext

Counts the number of onscreen windows belonging to a particular application.

Deprecated
NSShowsServicesMenuItem

Specifies whether a Services menu item is currently enabled.

NSDottedFrameRect

Draws a bordered rectangle.

NSWindowList

Gets information about onscreen windows.

Deprecated
NSWindowListForContext

Gets information about an application’s onscreen windows.

Deprecated
NSReadPixel

Reads the color of the pixel at the specified location.

Deprecated
NSGetWindowServerMemory

Returns the amount of memory being used by a context.

Deprecated