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

Previous items Next items

NSWindowMBS.disableSnapshotRestoration
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 13.2 Yes No No Yes, macOS only No
Function: Disable snapshot restoration.
Notes:
While snapshot restoration is disabled, the window will not be snapshotted for restorable state.
Available in OS X v10.7 and later.

Feedback, Comments & Corrections

NSWindowMBS.discardCachedImage
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: Discards all of the window's cached image rectangles.
Notes: An NSWindow object automatically discards its cached image rectangles when it displays.

Feedback, Comments & Corrections

NSWindowMBS.discardCursorRects
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: Invalidates all cursor rectangles in the window.
Notes: This method is invoked by resetCursorRects to clear out existing cursor rectangles before resetting them. You shouldn't invoke it in the code you write, but you might want to override it to change its behavior.

Feedback, Comments & Corrections

NSWindowMBS.display
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: Passes a display message down the window's view hierarchy, thus redrawing all views within the window, including the frame view that draws the border, title bar, and other peripheral elements.
Notes: You rarely need to invoke this method. NSWindow objects normally record which of their views need display and display them automatically on each pass through the event loop.

Feedback, Comments & Corrections

NSWindowMBS.displayIfNeeded
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: Passes a displayIfNeeded message down the window's view hierarchy, thus redrawing all views that need to be displayed, including the frame view that draws the border, title bar, and other peripheral elements.
Notes:
This method is useful when you want to modify some number of views and then display only the ones that were modified.

You rarely need to invoke this method. NSWindow objects normally record which of their views need display and display them automatically on each pass through the event loop.

Feedback, Comments & Corrections

NSWindowMBS.dockTile as Variant
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: Provides the application's Dock tile.
Notes: Available in Mac OS X v10.5 and later.

Feedback, Comments & Corrections

NSWindowMBS.dragImage(image as NSImageMBS, viewLocation as NSPointMBS, offset as NSSizeMBS, NSEvent as NSEventMBS, pboard as NSPasteboardMBS, source as NSViewMBS, slideFlag as boolean)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 13.5 Yes No No Yes, macOS only No
Function: Begins a dragging session.
Notes:
image: The object to be dragged.
imageLocation: Location of the image's bottom-left corner in the window's coordinate system. It determines the placement of the dragged image under the pointer.
offset: The pointer's location relative to the mouse-down location. Not used in OS X v10.4 and later.
NSEvent: The left-mouse down event that triggered the dragging operation.
pasteboard: The pasteboard that holds the data to be transferred to the destination.
source: The object serving as the controller of the dragging operation. It must conform to the NSDraggingSource protocol.
slideBack: Specifies whether the drag image should slide back to imageLocation if it's rejected by the drag destination. Pass true to specify slide back behavior or false to specify that it should not.

This method should be invoked only from within a view's implementation of the mouseDown or mouseDragged methods (which overrides the version defined in NSResponder class). Essentially the same as the NSView method of the same name, except that imageLocation is given in the NSWindow object's base coordinate system.

Feedback, Comments & Corrections

NSWindowMBS.enableCursorRects
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: Reenables cursor rectangle management within the window after a disableCursorRects message.

Feedback, Comments & Corrections

NSWindowMBS.enableFlushWindow
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: Reenables the flushWindow method for the window after it was disabled through a previous disableFlushWindow message.

Feedback, Comments & Corrections

NSWindowMBS.enableSnapshotRestoration
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 13.2 Yes No No Yes, macOS only No
Function: Enable snapshot restoration.
Notes:
While snapshot restoration is enabled, the window will be snapshotted for restorable state.
Available in OS X v10.7 and later.

Feedback, Comments & Corrections

NSWindowMBS.endEditingFor(anObject as object = nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 13.4 Yes No No Yes, macOS only No
Function: Forces the field editor to give up its first responder status and prepares it for its next assignment.
Notes:
anObject: The object that is using the window's field editor.

If the field editor is the first responder, it's made to resign that status even if its resignFirstResponder method returns false. This registration forces the field editor to send a textDidEndEditing message to its delegate. The field editor is then removed from the view hierarchy, its delegate is set to nil, and it's emptied of any text it may contain.

This method is typically invoked by the object using the field editor when it's finished. Other objects normally change the first responder by simply using makeFirstResponder, which allows a field editor or other object to retain its first responder status if, for example, the user has entered an invalid value. The endEditingFor: method should be used only as a last resort if the field editor refuses to resign first responder status. Even in this case, you should always allow the field editor a chance to validate its text and take whatever other action it needs first. You can do this by first trying to make the NSWindow object the first responder.

Feedback, Comments & Corrections

NSWindowMBS.fieldEditor(createFlag as boolean = True, forObject as object = nil) as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 13.4 Yes No No Yes, macOS only No
Function: Returns the window's field editor, creating it if requested.
Notes:
Returns NSTextMBS object. Returned as Variant to reduce plugin dependencies.

createWhenNeeded: If true, creates a field editor if one doesn't exist; if false, does not create a field editor.
A freshly created NSWindow object doesn't have a field editor. After a field editor has been created for a window, the createWhenNeeded argument is ignored. By passing false for createWhenNeeded and testing the return value, however, you can predicate an action on the existence of the field editor.
forObject: A text-displaying object for which the delegate (in windowWillReturnFieldEditor) assigns a custom field editor. Pass nil to get the default field editor, which can be the NSWindow field editor or a custom field editor returned by the delegate.

Returns the field editor for the designated object (anObject) or, if anObject is nil, the default field editor. Returns nil if createFlag is false and if the field editor doesn't exist.

The field editor is a single NSTextView object that is shared among all the controls in a window for light text-editing needs. It is automatically instantiated when needed, and it can be used however your application sees fit. Typically, the field editor is used by simple text-bearing objects—for example, an NSTextField object uses its window's field editor to display and manipulate text. The field editor can be shared by any number of objects, and so its state may be constantly changing. Therefore, it shouldn't be used to display text that demands sophisticated layout (for this you should create a dedicated NSTextView object).

The field editor may be in use by some view object, so be sure to properly dissociate it from that object before actually using it yourself (the appropriate way to do this is illustrated in the description of endEditingFor:). Once you retrieve the field editor, you can insert it in the view hierarchy, set a delegate to interpret text events, and have it perform whatever editing is needed. Then, when it sends a textDidEndEditing message to the delegate, you can get its text to display or store and remove the field editor using endEditingFor.

The window's delegate can substitute a custom field editor in place of the window's field editor by implementing windowWillReturnFieldEditor. The custom field editor can become the default editor (common to all text-displaying objects) or specific to a particular text-displaying object (anObject). The window sends this message to its delegate with itself and anObject as the arguments; if the delegate returns a non-nil value, the window returns that object instead of its field editor in fieldEditor. However, note the following:

If the window's delegate is identical to anObject, windowWillReturnFieldEditor isn't sent to the delegate.
The object returned by the delegate method, though it may become first responder, does not become the window's default field editor. Other objects continue to use the window's default field editor.

Feedback, Comments & Corrections

NSWindowMBS.firstResponder as NSResponderMBS
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: The window's first responder.
Notes:
The first responder is usually the first object in a responder chain to receive an event or action message. In most cases, the first responder is a view object in that the user selects or activates with the mouse or keyboard.

You can use the firstResponder method in custom subclasses of responder classes (NSWindow, NSApplication, NSView, and subclasses) to determine if an instance of the subclass is currently the first responder. You can also use it to help locate a text field that currently has first-responder status. For more on this subject, see Event Handling Basics (on developer.apple.com).

Feedback, Comments & Corrections

NSWindowMBS.flushWindow
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: Flushes the window's offscreen buffer to the screen if the window is buffered and flushing is enabled.
Notes: Does nothing for other display devices, such as a printer. This method is automatically invoked by the NSWindow display and displayIfNeeded methods and the corresponding NSView display and displayIfNeeded methods.

Feedback, Comments & Corrections

NSWindowMBS.flushWindowIfNeeded
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: Flushes the window's offscreen buffer to the screen if flushing is enabled and if the last flushWindow message had no effect because flushing was disabled.
Notes: To avoid unnecessary flushing, use this method rather than flushWindow to flush an NSWindow object after flushing has been reenabled.

Feedback, Comments & Corrections

NSWindowMBS.frame 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: The window's frame rectangle.

Feedback, Comments & Corrections

NSWindowMBS.frameAutosaveName as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa MBS MacBase Plugin 15.2 Yes No No Yes, macOS only No
Function: The name used to automatically save the window's frame rectangle data in the defaults system.
Notes: (Read and Write computed property)

Feedback, Comments & Corrections

NSWindowMBS.frameRectForContentRect(windowContent 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 frame rectangle with a given content rectangle.
Notes:
windowContent: The content rectangle for the window expressed in screen coordinates.

Returns the window's frame rectangle, expressed in screen coordinates, with windowContent.

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

See also:

Feedback, Comments & Corrections

NSWindowMBS.GetFrame(byref left as Double, byref top as Double, byref width as Double, byref height as Double)
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: Asks for the current window dimensions.
Notes: The point 0/0 is on the left bottom position.

Feedback, Comments & Corrections

NSWindowMBS.gState as Integer
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 window's graphics state object.
Notes: This graphics state is used by default for all NSView objects in the window's view hierarchy, but individual views can be made to use their own with the NSView method allocateGState.

Feedback, Comments & Corrections

NSWindowMBS.Hide
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: Hides the window.

Feedback, Comments & Corrections

NSWindowMBS.inLiveResize 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: Indicates whether the window is being resized by the user.
Notes: Available in Mac OS X v10.6 and later.

Feedback, Comments & Corrections

NSWindowMBS.invalidateCursorRectsForView(View as NSViewMBS)
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: Marks as invalid the cursor rectangles of a given NSView object in the window's view hierarchy, so they'll be set up again when the window becomes key (or immediately if the window is key).

Feedback, Comments & Corrections

NSWindowMBS.invalidateRestorableState
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacBase Plugin 13.2 Yes No No Yes, macOS only No
Function: Method that you may call to indicate that the restorable state is invalid.
Notes: At some point in the future, encodeRestorableStateWithCoder: will be called to encode the restorable state. You should not override this method.

Feedback, Comments & Corrections

NSWindowMBS.invalidateShadow
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: Invalidates the window shadow so that it is recomputed based on the current window shape.

Feedback, Comments & Corrections

NSWindowMBS.keyDown(e as NSEventMBS)
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: Handles a given keyboard event that may need to be interpreted as changing the key view or triggering a keyboard equivalent.
Notes: event: The keyboard event to process.

Feedback, Comments & Corrections

NSWindowMBS.makeFirstResponder(r as NSResponderMBS) 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: Attempts to make a given responder the first responder for the window.
Example:
dim MySearchField as NSViewMBS // your control to move focus to
dim w as new NSWindowMBS(window1)
call w.makeFirstResponder(MySearchField)
Notes:
responder: The responder to set as the window's first responder. nil makes the window its first responder.

Returns true when the operation is successful; otherwise, false.

If responder isn't already the first responder, this method first sends a resignFirstResponder message to the object that is the first responder. If that object refuses to resign, it remains the first responder, and this method immediately returns false. If the current first responder resigns, this method sends a becomeFirstResponder message to responder. If responder does not accept first responder status, the NSWindow object becomes first responder; in this case, the method returns true even if responder refuses first responder status.

If responder is nil, this method still sends resignFirstResponder to the current first responder. If the current first responder refuses to resign, it remains the first responder and this method immediately returns false. If the current first responder returns true from resignFirstResponder, the window is made its own first responder and this method returns true.

The Application Kit framework uses this method to alter the first responder in response to mouse-down events; you can also use it to explicitly set the first responder from within your program. The responder object is typically an NSView object in the window's view hierarchy. If this method is called explicitly, first send acceptsFirstResponder to responder, and do not call makeFirstResponder if acceptsFirstResponder returns false.

Use setInitialFirstResponder to the set the first responder to be used when the window is brought onscreen for the first time.

Feedback, Comments & Corrections

NSWindowMBS.makeKeyAndOrderFront
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: Moves the window to the front of the screen list, within its level, and makes it the key window; that is, it shows the window.
Notes: More or less the same as Real Studio's show command on the window class.

Feedback, Comments & Corrections

NSWindowMBS.makeKeyWindow
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: Makes the window the key window.

Feedback, Comments & Corrections

NSWindowMBS.makeMainWindow
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: Makes the window the main window.

Feedback, Comments & Corrections

Previous items Next items

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




Links
MBS FileMaker tutorial videos