Platforms to show: All Mac Windows Linux Cross-Platform
NSWindowMBS.setFrame(frameRect as NSRectMBS, display as boolean, animated as boolean)
Function:
Sets the origin and size of the window's frame rectangle, with optional animation, according to a given frame rectangle, thereby setting its position and size onscreen.
Notes:
The point 0/0 is on the bottom left position of the main screen.
If animated is true, the change is animated.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 11.2 | Yes | No | No | Yes, macOS only | No |
Notes:
The point 0/0 is on the bottom left position of the main screen.
If animated is true, the change is animated.
See also:
NSWindowMBS.SetFrame(left as Double, top as Double, width as Double, height as Double)
Function:
Sets the origin and size of the window's frame rectangle according to a given frame rectangle, thereby setting its position and size onscreen.
Notes: The point 0/0 is on the bottom left position of the main screen.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 9.6 | Yes | No | No | Yes, macOS only | No |
Notes: The point 0/0 is on the bottom left position of the main screen.
See also:
NSWindowMBS.setFrameAutosaveName(name as String) as boolean
Function:
Sets the name used to automatically save the window's frame rectangle in the defaults system to a given name.
Notes:
Returns true when the frame name is set successfully; false when frameName is being used as an autosave name by another NSWindow object in the application (in which case the window's old name remains in effect).
If frameName isn't the empty string (""), the window's frame is saved as a user default (as described in saveFrameUsingName) each time the frame changes.
When the window has an autosave name, its frame data is written whenever the frame rectangle changes.
If there is a frame rectangle previously stored for frameName in the user defaults, the window's frame is set to this frame rectangle. That is, when you call this method with a previously used frameName, the window picks up the previously saved setting. For example, if you call setFrameAutosaveName for a window that is already onscreen, this method could cause the window to move to a different screen location. For this reason, it is generally better to call this method before the window is visible on screen.
Keep in mind that a window controller may change the window's position when it displays it if window cascading is turned on. To preclude the window controller from changing a window's position from the one saved in the defaults system, you must send setShouldCascadeWindows(false) to the window controller.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 15.2 | Yes | No | No | Yes, macOS only | No |
Notes:
Returns true when the frame name is set successfully; false when frameName is being used as an autosave name by another NSWindow object in the application (in which case the window's old name remains in effect).
If frameName isn't the empty string (""), the window's frame is saved as a user default (as described in saveFrameUsingName) each time the frame changes.
When the window has an autosave name, its frame data is written whenever the frame rectangle changes.
If there is a frame rectangle previously stored for frameName in the user defaults, the window's frame is set to this frame rectangle. That is, when you call this method with a previously used frameName, the window picks up the previously saved setting. For example, if you call setFrameAutosaveName for a window that is already onscreen, this method could cause the window to move to a different screen location. For this reason, it is generally better to call this method before the window is visible on screen.
Keep in mind that a window controller may change the window's position when it displays it if window cascading is turned on. To preclude the window controller from changing a window's position from the one saved in the defaults system, you must send setShouldCascadeWindows(false) to the window controller.
NSWindowMBS.setFrameFromString(s as String)
Function:
Sets the window's frame rectangle from a given string representation.
Notes: If the window is not resizable, this method will not resize the window. The frame is constrained according to the window's minimum and maximum size settings. This method can cause a windowWillResize event.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 15.2 | Yes | No | No | Yes, macOS only | No |
Notes: If the window is not resizable, this method will not resize the window. The frame is constrained according to the window's minimum and maximum size settings. This method can cause a windowWillResize event.
NSWindowMBS.setFrameOrigin(point as NSPointMBS)
Function:
Positions the bottom-left corner of the window's frame rectangle at a given point in screen coordinates.
Notes: Note that the window server limits window position coordinates to ±16,000.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 9.6 | Yes | No | No | Yes, macOS only | No |
Notes: Note that the window server limits window position coordinates to ±16,000.
NSWindowMBS.setFrameTopLeftPoint(point as NSPointMBS)
Function:
Positions the top-left corner of the window's frame rectangle at a given point in screen coordinates.
Notes: Note that the window server limits window position coordinates to ±16,000; if necessary, adjust aPoint relative to the window's lower-left corner to account for this limit.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 9.6 | Yes | No | No | Yes, macOS only | No |
Notes: Note that the window server limits window position coordinates to ±16,000; if necessary, adjust aPoint relative to the window's lower-left corner to account for this limit.
NSWindowMBS.setFrameUsingName(name as String, force as boolean = false) as boolean
Function:
Sets the window's frame rectangle by reading the rectangle data stored under a given name from the defaults system.
Notes:
Returns true when frameName is read and the frame is set successfully; otherwise, false.
The frame is constrained according to the window's minimum and maximum size settings. This method causes a windowWillResize event.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 15.2 | Yes | No | No | Yes, macOS only | No |
Notes:
Returns true when frameName is read and the frame is set successfully; otherwise, false.
The frame is constrained according to the window's minimum and maximum size settings. This method causes a windowWillResize event.
NSWindowMBS.setRestorationClass
Function:
Specifies the class to use to acquire a matching window object during subsequent launches.
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 13.2 | Yes | No | No | Yes, macOS only | No |
Notes:
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.
NSWindowMBS.setTitleWithRepresentedFile(filename as folderitem)
Function:
Sets a given path as the window's title, formatting it as a file-system path, and records this path as the window's associated filename using setRepresentedFilename.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 9.6 | Yes | No | No | Yes, macOS only | No |
NSWindowMBS.setTitleWithRepresentedFilename(filename as string)
Function:
Sets a given path as the window's title, formatting it as a file-system path, and records this path as the window's associated filename using setRepresentedFilename.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 9.6 | Yes | No | No | Yes, macOS only | No |
NSWindowMBS.Show
Function:
Shows the window.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 8.2 | Yes | No | No | Yes, macOS only | No |
NSWindowMBS.standardWindowButton(button as Integer) as Variant
Function:
Returns the window button of a given window button kind in the window's view hierarchy.
Example:
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 12.1 | Yes | No | No | Yes, macOS only | No |
Example:
// another way to disable close button on Cocoa
dim n as NSButtonMBS = window1.NSWindowMBS.standardWindowButton(NSWindowMBS.NSWindowCloseButton)
n.isEnabled = false
// or move to to the right
dim r as NSRectMBS = n.frame
n.frame = NSMakeRectMBS(r.x+100, r.y, r.Width, r.Height)
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:
NSWindowMBS.stringWithSavedFrame as String
Function:
Returns a string representation of the window's frame rectangle.
Notes: A string representation of the window's frame rectangle in a format that can be used with a later setFrameFromString method.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 15.2 | Yes | No | No | Yes, macOS only | No |
Notes: 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()
Function:
Returns the entire group (stack) of windows that are all visually shown together in one virtual tabbed window and associated with this particular window.
Example:
Notes:
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 | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 16.5 | Yes | No | No | Yes, macOS only | No |
Example:
dim n as NSWindowMBS = window1.NSWindowMBS
dim windows() as NSWindowMBS = n.tabbedWindows
break // check in debugger
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.
NSWindowMBS.toggleFullScreen
Function:
Toggles fullscreen mode for this window.
Example:
Notes:
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 | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 11.2 | Yes | No | No | Yes, macOS only | No |
Example:
dim w as new NSWindowMBS(window1)
// set window to have fullscreen
w.collectionBehavior = BitwiseOr(w.collectionBehavior, NSWindowMBS.NSWindowCollectionBehaviorFullScreenPrimary)
// and switch to fullscreen
w.toggleFullScreen
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.
NSWindowMBS.toggleTabBar
Function:
Toggles tab bar.
Example:
Notes:
Raises an exception when used on OS X 10.11 and older.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 16.5 | Yes | No | No | Yes, macOS only | No |
Example:
dim n as NSWindowMBS = window1.NSWindowMBS
n.toggleTabBar
NSWindowMBS.toggleToolbarShown
Function:
The action method for the "Hide Toolbar" menu item (which alternates with "Show Toolbar").
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 9.6 | Yes | No | No | Yes, macOS only | No |
NSWindowMBS.toolbarview as NSViewMBS
Function:
Convenience function to find the toolbar view on the window.
Example:
Notes:
Returns nil if there is no toolbar view.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 13.1 | Yes | No | No | Yes, macOS only | No |
Example:
dim v as NSViewMBS = window1.NSWindowMBS.toolbarview
dim m as NSMenuMBS = v.Menu
dim i as NSMenuItemMBS = m.Item(0)
MsgBox i.title
NSWindowMBS.unregisterDraggedTypes
Function:
Unregisters the window as a possible destination for dragging operations.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 11.1 | Yes | No | No | Yes, macOS only | No |
NSWindowMBS.update
Function:
Updates the window.
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 8.3 | Yes | No | No | Yes, macOS only | No |
Notes:
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)
Function:
Specifies whether the window is to optimize focusing and drawing when displaying its views.
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 9.6 | Yes | No | No | Yes, macOS only | No |
Notes:
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
Function:
The Window handle.
Notes:
Can be used with the CarbonWindowsEventsMBS class.
(for events like open and close)
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 8.2 | Yes | No | No | Yes, macOS only | No |
Notes:
Can be used with the CarbonWindowsEventsMBS class.
(for events like open and close)
NSWindowMBS.zoom
Function:
This action method toggles the size and location of the window between its standard state (provided by the application as the "best" size to display the window's data) and its user state (a new size and location the user may have set by moving or resizing the window).
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Cocoa | MBS MacBase Plugin | 8.4 | Yes | No | No | Yes, macOS only | No |
The items on this page are in the following plugins: MBS MacBase Plugin.

Links
MBS FileMaker tutorial videos