Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSApplicationMBS class.

Previous items

NSApplicationMBS.unhideAllApplications

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 11.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Unhides all applications, including the receiver.
Example
NSApplicationMBS.sharedApplication.unhideAllApplications

This action causes each application to order its windows to the front, which could obscure the currently active window in the active application.

NSApplicationMBS.unhideWithoutActivation

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Restores hidden windows without activating their owner (the receiver).
Example
NSApplicationMBS.sharedApplication.unhideWithoutActivation

When this method begins, it posts an NSApplicationWillUnhideNotification to the default notification center. If it completes successfully, it posts an NSApplicationDidUnhideNotification.

NSApplicationMBS.updateWindows

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Sends an update message to each onscreen window.

This method is invoked automatically in the main event loop after each event when running in NSDefaultRunLoopMode or NSModalRunLoopMode. This method is not invoked automatically when running in NSEventTrackingRunLoopMode.

When this method begins, it posts an NSApplicationWillUpdateNotification to the default notification center. When it successfully completes, it posts an NSApplicationDidUpdateNotification.

NSApplicationMBS.updateWindowsItem(win as NSWindowMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Updates the Window menu item for a given window to reflect the edited status of that window.

win: The window whose menu item is to be updated.

You rarely need to invoke this method because it is invoked automatically when the edit status of an NSWindow object is set.

NSApplicationMBS.windows as NSWindowMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns an array containing the receiver's window objects.
Example
// show all window titles in message boxes
for each w as NSWindowMBS in NSApplicationMBS.sharedApplication.windows
MsgBox w.Title
next

Returns an array of NSWindow objects. This array includes both onscreen and offscreen windows.

Some examples using this method:

NSApplicationMBS.windowWithWindowNumber(windowNumber as Integer) as NSWindowMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the window corresponding to the specified window number.
Example
dim w as window = window1
w.Title = "This is our test window"

// get a window ID somewhere
dim WindowID as Integer = CGWindowMBS.GetWindowID(w)

// now find back the window
dim n as NSWindowMBS = NSApplicationMBS.sharedApplication.windowWithWindowNumber(windowid)

MsgBox n.Title

windowNumber: The unique window number associated with the desired NSWindow object.

Returns the desired window object or nil if the window could not be found.

Previous items

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


The biggest plugin in space...