Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSWindowMBS class.

Previous items

NSWindowMBS.resignMainWindow

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Invoked automatically when the window resigns main window status; never invoke this method directly.

This method sends windowDidResignMain to the window's delegate and posts an NSWindowDidResignMainNotification to the default notification center.

NSWindowMBS.resizeFlags as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Returns the flags field of the event record for the mouse-down event that initiated the resizing session.

A mask indicating which of the modifier keys was held down when the mouse-down event occurred. The flags are listed in NSEvent object's modifierFlags method description.

This method is valid only while the window is being resized

You can use this method to constrain the direction or amount of resizing. Because of its limited validity, this method should only be invoked from within an implementation of the delegate method windowWillResize.

NSWindowMBS.restoreCachedImage

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Splices the window's cached image rectangles, if any, back into its raster image (and buffer if it has one), undoing the effect of any drawing performed within those areas since they were established using cacheImageInRect.

You must invoke flushWindow after this method to guarantee proper redisplay. An NSWindow object automatically discards its cached image rectangles when it displays.

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
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
Var n as NSWindowMBS = window1.NSWindowMBS
Var 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

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 11.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Toggles fullscreen mode for this window.
Example
Var 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

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 16.5 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Toggles tab bar.
Example
Var n as NSWindowMBS = window1.NSWindowMBS
n.toggleTabBar

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
The action method for the "Hide Toolbar" menu item (which alternates with "Show Toolbar").

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
Convenience function to find the toolbar view on the window.
Example
Var v as NSViewMBS = window1.NSWindowMBS.toolbarview
Var m as NSMenuMBS = v.Menu
Var i as NSMenuItemMBS = m.Item(0)
MsgBox i.title

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
Unregisters the window as a possible destination for dragging operations.

NSWindowMBS.update

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Updates the window.

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
Specifies whether the window is to optimize focusing and drawing when displaying its views.

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
The Window handle.

Can be used with the CarbonWindowsEventsMBS class.
(for events like open and close)

NSWindowMBS.zoom

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 8.4 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
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).

Previous items

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


The biggest plugin in space...