Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSAppearanceMBS class.

NSAppearanceMBS.appearance(item as Variant) as NSAppearanceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 14.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The appearance of the receiver, in an NSAppearance object.
Example
// check NSMenuItemMBS
Dim n As New NSMenuItemMBS(EditCopy)
Dim e1 As NSAppearanceMBS = NSAppearanceMBS.Appearance(n)

// check MenuItem
Dim e2 As NSAppearanceMBS = NSAppearanceMBS.Appearance(EditCopy)

// check NSMenuMBS
Dim e3 As NSAppearanceMBS = NSAppearanceMBS.Appearance(n.menu)

Break

The default value for this property is nil, which means that the receiver uses the appearance it inherits from the nearest ancestor that has set an appearance. When you set appearance to a non-nil value, the receiver and the views it contains use the specified appearance.

Version 20.5 of MBS Plugin can accept application or NSApplicationMBS objects to query appearance of whole app.

Version 24.2 accepts NSMenuMBS, MenuItem, DesktopMenuItem and NSMenuItemMBS objects here.

NSAppearanceMBS.appearanceNamed(name as string) as NSAppearanceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 14.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the NSAppearance object with the specified name.

name: The name of a standard or custom appearance.
Returns a standard or custom appearance object.

When you specify a standard appearance name—such as NSAppearanceNameAqua—this method returns a built-in appearance. If you specify a custom appearance name, this method searches the main bundle for an appearance file that has the specified name.
Available in OS X v10.9 and later.

See also:

Some examples using this method:

NSAppearanceMBS.appearanceNamed(name as string, bundle as NSBundleMBS) as NSAppearanceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 14.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates an NSAppearance object initialized to the specified appearance file in the specified bundle.

name: The name of the appearance file to search for, without any path information.
bundle: The bundle in which to search for the appearance file. If bundle is nil, this method searches in the main bundle.

Returns an initialized appearance object, or nil if an error occurs.
Available in OS X v10.9 and later.

See also:

NSAppearanceMBS.Available as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 14.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Whether this class is available.

NSAppearanceMBS.currentAppearance as NSAppearanceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 14.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the NSAppearance object that’s set on the current thread.
Example
MsgBox NSAppearanceMBS.currentAppearance.name

When a UI element draws on the screen, it automatically sets the appearance that it’s using on the current thread.
Available in OS X v10.9 and later.

Some examples using this method:

NSAppearanceMBS.effectiveAppearance(item as Variant) as NSAppearanceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 14.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The appearance that will be used when the receiver is drawn onscreen, in an NSAppearance object.
Example
// try three variants to get appearance for menu items

// check NSMenuItemMBS
Dim n As New NSMenuItemMBS(EditCopy)
Dim e1 As NSAppearanceMBS = NSAppearanceMBS.effectiveAppearance(n)

// check MenuItem
Dim e2 As NSAppearanceMBS = NSAppearanceMBS.effectiveAppearance(EditCopy)

// check NSMenuMBS
Dim e3 As NSAppearanceMBS = NSAppearanceMBS.effectiveAppearance(n.menu)

Break

The default value for this property is provided by the nearest ancestor of the receiver that has set an appearance.
You can use this property to ensure that an offscreen view sets the appropriate current appearance when it draws onscreen.
Available in OS X v10.9 and later.

Version 20.5 of MBS Plugin can accept application or NSApplicationMBS objects to query appearance of whole app.

Version 24.2 accepts NSMenuMBS, MenuItem, DesktopMenuItem and NSMenuItemMBS objects here.

NSAppearanceMBS.NSAppearanceNameAccessibilityHighContrastAqua as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 19.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A high-contrast version of the standard light system appearance.

Don't assign an NSAppearanceMBS object with this type directly to one of your views. Instead, assign a light appearance to your view. AppKit then returns this type when the user enables the Increase Contrast option in the Accessibility system preferences.
Available on MacOS 10.14 or newer.

NSAppearanceMBS.NSAppearanceNameAccessibilityHighContrastDarkAqua as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 19.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A high-contrast version of the standard dark system appearance.

Don't assign an NSAppearanceMBS object with this type directly to one of your views. Instead, assign a dark appearance to your view. AppKit then returns this type when the user enables the Increase Contrast option in the Accessibility system preferences.
Available on MacOS 10.14 or newer.

NSAppearanceMBS.NSAppearanceNameAccessibilityHighContrastVibrantDark as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 19.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A high-contrast version of the dark vibrant appearance.

Don't assign an NSAppearanceMBS object with this type directly to one of your views. Instead, assign a dark appearance to your view. AppKit then returns this type when the user enables the Increase Contrast option in the Accessibility system preferences and the view's allowsVibrancy property is true.
Available on MacOS 10.14 or newer.

NSAppearanceMBS.NSAppearanceNameAccessibilityHighContrastVibrantLight as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 19.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A high-contrast version of the light vibrant appearance.

Don't assign an NSAppearanceMBS object with this type directly to one of your views. Instead, assign a light appearance to your view. AppKit then returns this type when the user enables the Increase Contrast option in the Accessibility system preferences and the view's allowsVibrancy property is true.
Available on MacOS 10.14 or newer.

NSAppearanceMBS.NSAppearanceNameAqua as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 14.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The name of the standard Aqua appearance.

NSAppearanceMBS.NSAppearanceNameDarkAqua as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 20.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The name of the dark mode Aqua appearance.

NSAppearanceMBS.NSAppearanceNameLightContent as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 14.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The name of the standard appearance that can be used by controls in light content areas (not including window-frame areas).

NSAppearanceMBS.NSAppearanceNameVibrantDark as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 14.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The name of the vibrant dark appearance.

Available on Mac OS X 10.10 and newer.
Should only be set on an NSVisualEffectView, or one of its container subviews.

Some examples using this method:

NSAppearanceMBS.NSAppearanceNameVibrantLight as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 14.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The name of the vibrant dark appearance.

Available on Mac OS X 10.10 and newer.
Should only be set on an NSVisualEffectView, or one of its container subviews.

NSAppearanceMBS.setAppearance(item as Variant, appearance as NSAppearanceMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 14.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the appearance of the receiver, in an NSAppearance object.
Example
// set the app to dark mode
Dim a As NSAppearanceMBS = NSAppearanceMBS.appearanceNamed(NSAppearanceMBS.NSAppearanceNameDarkAqua)
NSAppearanceMBS.setAppearance(app, a)

The default value for this property is nil, which means that the receiver uses the appearance it inherits from the nearest ancestor that has set an appearance. When you set appearance to a non-nil value, the receiver and the views it contains use the specified appearance.

Version 20.5 of MBS Plugin can accept application or NSApplicationMBS objects to set appearance of whole app.

Some examples using this method:

NSAppearanceMBS.setCurrentAppearance(appearance as NSAppearanceMBS = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacFrameworks Plugin 14.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the current appearance to the specified NSAppearance object.

appearance: The NSAppearance object that should be used for the window or view, or nil to specify the default appearance.

When you set an appearance on a window, all views in that window—including the window background and controls in both the frame and content areas—use that appearance. By default, AppKit sets the current appearance for standard windows and views during window drawing, so you don't need to use this method unless you want to change the current appearance of a specific window or view.

You can use this method to set the current appearance for an offscreen view to the appearance that will be used when the view is drawn. To do this, use the offscreen view’s effectiveAppearance for the appearance parameter.

Available in OS X v10.9 and later.

Some examples using this method:

The items on this page are in the following plugins: MBS MacFrameworks Plugin.


The biggest plugin in space...