Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSWindowMBS class.
NSWindowMBS.setRestorationClass
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
The plugin provides a class to restore windows. See NSWindowRestoreHandlerMBS class.
The restoration class of a window is responsible for recreating not just the window but any other objects needed to manage the window. Therefore, the restoration class must be able to create (or find existing instances of) all of these objects at launch time in your application.
If you mark your windows as restorable, you must associate a restoration class with them.
Available in OS X v10.7 and later.
Some examples using this method:
NSWindowMBS.setTitleWithRepresentedFile(filename as folderitem)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
NSWindowMBS.setTitleWithRepresentedFilename(filename as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 8.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
NSWindowMBS.standardWindowButton(button as Integer) as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 12.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
button: The kind of standard window button to return.
Returns Window button in the window's view hierarchy of the kind identified by windowButtonKind; nil when such button is not in the window's view hierarchy.
Declared as Variant for reduced plugin dependencies.
Button constants: NSWindowCloseButton, NSWindowDocumentIconButton, NSWindowMiniaturizeButton, NSWindowToolbarButton and NSWindowZoomButton.
See also:
Some examples using this method:
NSWindowMBS.stringWithSavedFrame as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 15.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
A string representation of the window's frame rectangle in a format that can be used with a later setFrameFromString method.
NSWindowMBS.tabbedWindows as NSWindowMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 16.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Operations can then be done on each window, as necessary. For instance, iterating over each window in the group and calling performClose: will close the entire stack. The result will be nil when the window is not tabbed at all (not showing a tab bar), and non-nil with at least one object when the tab bar is shown. The order of items in the array is the same order as the tabs visually shown (leading to trailing).
Raises an exception when used on OS X 10.11 and older.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Available on Mac OS X 10.7 or later.
If an application supports fullscreen, it should add a menu item to the View menu with toggleFullScreen as the action.
This method does not much if you don't mark a window to be the primary fullscreen window.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 16.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Raises an exception when used on OS X 10.11 and older.
NSWindowMBS.toggleToolbarShown
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
NSWindowMBS.toolbarview as NSViewMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Returns nil if there is no toolbar view.
NSWindowMBS.unregisterDraggedTypes
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 8.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
The NSWindow implementation of this method does nothing more than post an NSWindowDidUpdateNotification notification to the default notification center. A subclass can override this method to perform specialized operations, but it should send an update message to super just before returning. For example, the NSMenu class implements this method to disable and enable menu commands.
An NSWindow object is automatically sent an update message on every pass through the event loop and before it's displayed onscreen. You can manually cause an update message to be sent to all visible NSWindow objects through the NSApplication updateWindows method.
NSWindowMBS.useOptimizedDrawing(value as boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
value: If true, the window will optimize focusing and drawing for its views; if false, it will not, in which case, the window does not preserve the Z-ordering of overlapping views when an object explicitly sends lockFocus to a view and draws directly to it, instead of using the AppKit standard display mechanism.
The optimizations may prevent sibling subviews from being displayed in the correct order—which matters only if the subviews overlap. You should always set optimizedDrawing to true when there are no overlapping subviews within the window. The default is false.
NSWindowMBS.WindowHandle as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 8.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Can be used with the CarbonWindowsEventsMBS class.
(for events like open and close)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
The items on this page are in the following plugins: MBS MacBase Plugin.