Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSWindowRestoreHandlerMBS class.

NSWindowRestoreHandlerMBS.RestoreWindow(identifier as string, state as Variant)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa MBS MacBase Plugin 13.2 ✅ Yes ❌ No ❌ No ❌ No
The following event is sent to request that a window be restored.

State is a NSCoderMBS object.

If the receiver knows how to restore the identified window, it should invoke the completion handler with the window, possibly creating it. It is acceptable to invoke the completion handler with a pre-existing window, though you should not pass the same window to more than one completion handler. If the receiver cannot restore the identified window (for example, the window referenced a document that has been deleted), it should invoke the completion handler with a nil window. In Mac OS X 10.7, the error parameter is ignored.

The receiver is passed the identifier of the window, which allows the receiver to quickly check for known windows. For example, you might give your preferences window an identifier of "preferences" in the nib, and then check for that identifier in your implementation. The receiver is also passed the NSCoder containing the combined restorable state of the window, its delegate, the window controller, and any document. The receiver may decode information previously stored in the coder to determine what window to restore.

Please call SetRestoredWindow or SetError to pass back status to system. It is not necessary or recommended for implementations of this method to order restored windows onscreen (for example, the window may have been minimized, in which case it will not be ordered onscreen).

Please call SetError and SetRestoredWindow to provide result to system.

Some examples using this event:

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


The biggest plugin in space...