Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSScreenMBS class.

NSScreenMBS.deepestScreen as NSScreenMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns an NSScreen object representing the screen that can best represent color.

This method always returns an object, even if there is only one screen and it is not a color screen.
(Read only property)

NSScreenMBS.firstScreen as NSScreenMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Cocoa MBS MacBase Plugin 12.4 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Returns the NSScreen object for the first screen.
Example
MessageBox NSScreenMBS.firstScreen.localizedName

Returns nil if no display is present.
(Read only property)

NSScreenMBS.mainScreen as NSScreenMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Returns the NSScreen object containing the window with the keyboard focus.
Example
Dim mainScreen As NSScreenMBS = NSScreenMBS.mainScreen

msgbox mainScreen.localizedName

The main screen is not necessarily the same screen that contains the menu bar or has its origin at (0, 0). The main screen refers to the screen containing the window that is currently receiving keyboard events. It is the main screen because it is the one with which the user is most likely interacting.

The screen containing the menu bar is always the first object (index 0) in the array returned by the screens method.
(Read only property)

Some examples using this property:

NSScreenMBS.screensHaveSeparateSpaces as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Cocoa MBS MacBase Plugin 19.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value indicating whether each screen can have its own set of spaces.

This method reflects whether the “Displays have separate Spaces” option is enabled in Mission Control system preference. You might use the return value to determine how to present your app when in fullscreen mode.
(Read only property)

NSScreenMBS.secondScreen as NSScreenMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Cocoa MBS MacBase Plugin 12.4 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Returns the NSScreen object for the second screen.

Returns nil if no second display is present.
(Read only property)

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


The biggest plugin in space...