Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

NSWindowMBS.addChildWindow(win as NSWindowMBS, order as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 11.2 Yes No No Yes, macOS only No
Function: Adds a given window as a child window of the window.
Notes:
win: The child window to order.
order: Either NSWindowAbove: childWindow is ordered immediately in front of the window, or NSWindowBelow: childWindow is ordered immediately behind the window.

After the childWindow is added as a child of the window, it is maintained in relative position indicated by order mode for subsequent ordering operations involving either window. While this attachment is active, moving childWindow will not cause the window to move (as in sliding a drawer in or out), but moving the window will cause childWindow to move.

Note that you should not create cycles between parent and child windows. For example, you should not add window B as child of window A, then add window A as a child of window B.

See also:

Feedback, Comments & Corrections

NSWindowMBS.addChildWindow(win as window, order as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 11.2 Yes No No No No
Function: Adds a given window as a child window of the window.
Notes:
win: The child window to order.
order: Either NSWindowAbove: childWindow is ordered immediately in front of the window, or NSWindowBelow: childWindow is ordered immediately behind the window.

After the childWindow is added as a child of the window, it is maintained in relative position indicated by order mode for subsequent ordering operations involving either window. While this attachment is active, moving childWindow will not cause the window to move (as in sliding a drawer in or out), but moving the window will cause childWindow to move.

Note that you should not create cycles between parent and child windows. For example, you should not add window B as child of window A, then add window A as a child of window B.

See also:

Feedback, Comments & Corrections

NSWindowMBS.addTabbedWindow(win as NSWindowMBS, ordered as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 16.5 Yes No No Yes, macOS only No
Function: Allows creating a group of tabbed windows, or adding a new window to an existing tabbed window group.
Example:
dim n as NSWindowMBS = window1.NSWindowMBS

n.addTabbedWindow(Window2, n.NSWindowAbove)
Notes:
The 'window' will be added to the receiver's tabbed window group, or create a group if needed. The tabbingIdentifier for the entire group should be the same for all the windows, otherwise an exception will be thrown. Use the ordered parameter with "NSWindowAbove" and "NSWindowBelow" to place the new window before or after the receiver's tab. Passing "NSWindowOut" will thrown an exception. Currently this method is not animatable, but that may change in the future.
Raises an exception when used on OS X 10.11 and older.

Feedback, Comments & Corrections

NSWindowMBS.animator as NSWindowMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 10.0 Yes No No Yes, macOS only No
Function: Returns the proxy object for this window which animates.
Example:
dim v as NSWindowMBS // your NSWindowMBS object

v.alphaValue = 0.5 // switch alpha directly
v.animator.alphaValue = 0.5 // switch alpha animated

Feedback, Comments & Corrections

NSWindowMBS.areCursorRectsEnabled as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: Whether the window's cursor rectangles are enabled.
Notes: Available in Mac OS X v10.0 and later.

Feedback, Comments & Corrections

NSWindowMBS.attachedSheet as NSWindowMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: Returns the sheet attached to the window.
Notes:
The sheet attached to the window; nil when the window doesn't have a sheet attached.

Available in Mac OS X v10.1 and later.

Feedback, Comments & Corrections

NSWindowMBS.autorecalculatesContentBorderThicknessForEdge(edge as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 11.1 Yes No No Yes, macOS only No
Function: Indicates whether the window calculates the thickness of a given border automatically.
Notes:
edge: Border whose thickness autorecalculation status to set:

NSMaxYEdge: Top border.
NSMinYEdge: Bottom border.

Returns true when the window auto-recalculates the given border's thickness; otherwise, false.

Requires Mac OS X 10.5.

Feedback, Comments & Corrections

NSWindowMBS.becomeKeyWindow
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: Invoked automatically to inform the window that it has become the key window; never invoke this method directly.
Notes: This method reestablishes the window's first responder, sends the becomeKeyWindow message to that object if it responds, and posts an NSWindowDidBecomeKeyNotification to the default notification center.

Feedback, Comments & Corrections

NSWindowMBS.becomeMainWindow
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: Invoked automatically to inform the window that it has become the main window; never invoke this method directly.

Feedback, Comments & Corrections

NSWindowMBS.cacheImageInRect(r as NSRectMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: Stores the window's raster image from a given rectangle expressed in the window's base coordinate system.
Notes:
This method allows the window to perform temporary drawing, such as a band around the selection as the user drags the mouse, and to quickly restore the previous image by invoking restoreCachedImage and flushWindowIfNeeded. The next time the window displays, it discards its cached image rectangles. You can also explicitly use discardCachedImage to free the memory occupied by cached image rectangles. aRect is made integral before caching the image to avoid antialiasing artifacts.

Only the last cached rectangle is remembered and can be restored.

Feedback, Comments & Corrections

NSWindowMBS.Center
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 8.6 Yes No No Yes, macOS only No
Function: Sets the window's location to the center of the screen.
Notes:
The window is placed exactly in the center horizontally and somewhat above center vertically. Such a placement carries a certain visual immediacy and importance. This method doesn't put the receiver onscreen, however; use makeKeyAndOrderFront (show) to do that.

You typically use this method to place a window—most likely an alert dialog—where the user can't miss it. This method is invoked automatically when a panel is placed on the screen by the runModalForWindow method of the NSApplication class.

Feedback, Comments & Corrections

CenterResizeAddWindowMBS(win as window)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Cocoa MBS MacExtras Plugin 15.1 Yes No No No No
Function: Adds a window to the list of center resizing windows.
Notes: Please call in open event of window.

Some examples using this method:

Feedback, Comments & Corrections

CenterResizeInstallMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Cocoa MBS MacExtras Plugin 15.1 Yes No No No No
Function: Installs the center resize function.
Notes:
The plugin can provide for Xojo and Real Studio the center based window resizing.
Call this method early in app.open to prepare everything.

Than register windows with CenterResizeAddWindowMBS in window open event and unregister with CenterResizeRemoveWindowMBS in window close event. This works for all windows you register.

Some examples using this method:

Feedback, Comments & Corrections

CenterResizeRemoveWindowMBS(win as window)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Cocoa MBS MacExtras Plugin 15.1 Yes No No No No
Function: Removes a window from the list of center resizing windows.
Notes: Please call in Close event of window.

Some examples using this method:

Feedback, Comments & Corrections

NSWindowMBS.childWindows as NSWindowMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 11.2 Yes No No Yes, macOS only No
Function: Returns an array of the window's attached child windows.

Feedback, Comments & Corrections

NSWindowMBS.ClearFocus
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 8.2 Yes No No Yes, macOS only No
Function: Clears the focus.
Notes: Moves the focus back to the window.

Feedback, Comments & Corrections

NSWindowMBS.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
Function: Closes the window.

Feedback, Comments & Corrections

NSWindowMBS.Constructor(w as window)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 9.4 Yes No No No No
Function: Creates a NSWindow for the given REALbasic window.
Example:
dim w as new NSWindowMBS(window1)

MsgBox w.Title
Notes:
In plugin version 9.4 and newer this works only with Cocoa windows.
In plugin version 9.7 and newer you can use it also for Carbon windows.

See also:

Feedback, Comments & Corrections

NSWindowMBS.Constructor(x as Double, y as Double, w as Double, h as Double, styleMask as Integer, BackingStoreType as Integer = 0, deferCreation as boolean = false, canBecomeKeyWindow as boolean = false)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 8.4 Yes No No Yes, macOS only No
Function: The constructor to create a new Cocoa Windows.
Notes:
x,y,w,h:
Location and size of the window's content area in screen coordinates. Note that the window server limits window position coordinates to ±16,000 and sizes to 10,000.

styleMask:
The window's style. Either it can be NSBorderlessWindowMask, or it can contain any of the options described in the constants, combined using the bitwiseOR function. Borderless windows display none of the usual peripheral elements and are generally useful only for display or caching purposes; you should normally not need to create them. Also, note that a window's style mask should include NSTitledWindowMask if it includes any of the others.

bufferingType:
Specifies how the drawing done in the window is buffered by the window device, and possible values are described in "Constants."

deferCreation:
Specifies whether the window server creates a window device for the window immediately. When true, the window server defers creating the window device until the window is moved onscreen. All display messages sent to the window or its views are postponed until the window is created, just before it's moved onscreen.

Initialized NSWindow object.

This method is the designated initializer for the NSWindow class.

Deferring the creation of the window improves launch time and minimizes the virtual memory load on the window server.

The new window creates a view to be its default content view. You can replace it with your own object by using the ContentView property.

Parameter canBecomeKeyWindow (in 11.3 plugin) controls whether we use a special NSWindow subclass which returns true for the canBecomeKeyWindow function. This way you can create windows which can take key focus.

See also:

Feedback, Comments & Corrections

NSWindowMBS.contentBorderThicknessForEdge(edge as Integer) as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 11.1 Yes No No Yes, macOS only No
Function: Indicates the thickness of a given border of the window.
Notes:
edge: The border whose thickness to get:

NSMaxYEdge: Top border.
NSMinYEdge: Bottom border.

Requires Mac OS X 10.5.

Feedback, Comments & Corrections

NSWindowMBS.contentRectForFrameRect(windowFrame as NSRectMBS) as NSRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 11.3 Yes No No Yes, macOS only No
Function: Returns the window's content rectangle with a given frame rectangle.
Example:
dim w as NSWindowMBS = window1.NSWindowMBS
dim fr as NSRectMBS = w.frame
dim cr as NSRectMBS = w.contentRectForFrameRect(fr)

MsgBox "Title height: "+str(fr.Height-cr.Height)
Notes:
windowFrame: The frame rectangle for the window expressed in screen coordinates.

Returns the window's content rectangle, expressed in screen coordinates, with windowFrame.

The window uses its current style mask in computing the content rectangle. See Window Style Mask constants for a list of style mask values. The main advantage of this instance-method counterpart to contentRectForFrameRect (With styleMask) is that it allows you to take toolbars into account when converting between content and frame rectangles. (The toolbar is not included in the content rectangle.)

See also:

Feedback, Comments & Corrections

NSWindowMBS.convertBaseToScreen(p as NSPointMBS) as NSPointMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: Converts a given point from the window's base coordinate system to the screen coordinate system.

Feedback, Comments & Corrections

NSWindowMBS.convertScreenToBase(p as NSPointMBS) as NSPointMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: Converts a given point from the screen coordinate system to the window's base coordinate system.

Feedback, Comments & Corrections

NSWindowMBS.dataWithEPSInsideRect(r as NSRectMBS) as Memoryblock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: Returns EPS data that draws the region of the window within a given rectangle.
Notes: This data can be placed on a pasteboard, written to a file, or used to create an NSImage object.

Feedback, Comments & Corrections

NSWindowMBS.dataWithPDFInsideRect(r as NSRectMBS) as Memoryblock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: Returns PDF data that draws the region of the window within a given rectangle.
Notes: This data can be placed on a pasteboard, written to a file, or used to create an NSImage object.

Feedback, Comments & Corrections

NSWindowMBS.deminiaturize
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 8.4 Yes No No Yes, macOS only No
Function: This action method deminimizes the receiver.
Notes: Invoke this method to programmatically deminimize a minimized window in the Dock.

Feedback, Comments & Corrections

NSWindowMBS.disableCursorRects
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: Disables all cursor rectangle management within the window.
Notes: Use this method when you need to do some special cursor manipulation and you don't want the Application Kit interfering.

Feedback, Comments & Corrections

NSWindowMBS.disableFlushWindow
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: Disables the flushWindow method for the window.
Notes:
If the window is buffered, disabling flushWindow prevents drawing from being automatically flushed by the NSView display... methods from the window's backing store to the screen. This method permits several views to be drawn before the results are shown to the user.

Flushing should be disabled only temporarily, while the window's display is being updated. Each disableFlushWindow message must be paired with a subsequent enableFlushWindow message. Invocations of these methods can be nested; flushing isn't reenabled until the last (unnested) enableFlushWindow message is sent.

Feedback, Comments & Corrections

NSWindowMBS.disableScreenUpdatesUntilFlush
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: Disables the window's screen updates until the window is flushed.
Notes:
This method can be invoked to synchronize hardware surface flushes with the window's flushes. The window immediately disables screen updates using the NSDisableScreenUpdates function and reenables screen updates when the window flushes. Sending this message multiple times during a window update cycle has no effect.

Available in Mac OS X v10.4 and later.

Feedback, Comments & Corrections

Next items

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




Links
MBS FileMaker Plugins