Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSViewMBS class.
NSViewMBS.addSubview(subview as NSViewMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
See also:
Some examples using this method:
- /Mac64bit/Contacts/CNContactViewController test
- /MacBase/Custom NSWindows/NSWindow like AppStore/AppStore NSWindow
- /MacCocoa/Background view over titlebar
- /MacCocoa/Dynamic FileOpenDialog
- /MacCocoa/NSStatusItem/Statusitem with textfield in menubar
- /MacControls/NSCollectionView Test
- /MacControls/Popover/Popover window
- /MacExtras/Attached Window
- /MacExtras/MAAttachedWindow/MAAttachedWindow Demo
- /MacFrameworks/Cocoa Controls/TableView
NSViewMBS.addSubview(subview as NSViewMBS, positioned as Integer, relativeToView as NSViewMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
subView: The view object to add to the receiver as a subview.
positioned: A constant specifying the position of the aView relative to otherView. Valid values are NSWindowAbove or NSWindowBelow.
relativeToView: The other view subView is to be positioned relative to. If relativeToView is nil (or isn't a subview of the receiver), subView is added above or below all of its new siblings.
This method also sets the receiver as the next responder of aView.
See also:
NSViewMBS.addToolTipRect(rect as NSRectMBS, tooltip as NSViewTooltipMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 18.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Rect: A rectangle defining the region of the view to associate the tooltip with.
tooltip: The object to provide text.
Please keep reference of tooltip object as the tooltip is removed by it's destructor.
Some examples using this method:
NSViewMBS.adjustScroll(rect as NSRectMBS) as NSRectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 24.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
rect: A rectangle that defines a region of the view.
NSClipView invokes this method to allow its document view to adjust its position during scrolling. For example, a custom view object that displays a table of data can adjust the origin of newVisible so rows or columns aren’t cut off by the edge of the enclosing NSClipView. The NSView implementation simply returns newVisible.
NSClipView only invokes this method during automatic or user controlled scrolling. Its scrollToPoint: method doesn’t invoke this method, so you can still force a scroll to an arbitrary point.
In Xojo, you can't overwrite this, but use it to adjust a rectangle by the view.
NSViewMBS.ancestorSharedWithView(view as NSViewMBS) as NSViewMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The closest ancestor or nil if there's no such object. Returns self if aView is identical to the receiver.
NSViewMBS.animator as NSViewMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 10.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
NSViewMBS.autoscroll(e as NSEventMBS) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 24.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
e: An event object whose location should be expressed in the window’s base coordinate system (which it normally is), not the receiving view's.
Returns true if any scrolling is performed; otherwise returns false.
View objects that track mouse-dragged events can use this method to scroll automatically when the cursor is dragged outside of the NSClipView object. Repeated invocations of this method (with an appropriate delay) result in continual scrolling, even when the mouse doesn’t move.
NSViewMBS.backgroundFilters as variant()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 18.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This property contains an array of CIFilterMBS objects. This array represents the background filters stored in the backgroundFilters property of the view’s layer. If the view does not have a layer, setting the value of this property has no effect.
The default value of this property is an empty array.
We use variant here to reduce plugin dependencies. Please use with array of variants containing CIFilterMBS.
NSViewMBS.beginDraggingSessionWithItems(items() as Variant, e as NSEventMBS, source as NSViewMBS) as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
items: The dragging items (array of variant containing NSDraggingItemMBS objects). The frame property of each NSDraggingItem must be in the view's coordinate system.
event: The mouse-down event object from which to initiate the drag operation. In particular, its mouse location is used for the offset of the icon being dragged.
source: An object that serves as the controller of the dragging operation. It must conform to the NSDraggingSource informal protocol and is typically the receiver itself or its NSWindow object.
Returns the dragging session for the drag (NSDraggingSessionMBS object). Returned as Variant to reduce plugin dependencies.
A basic drag starts by calling beginDraggingSessionWithItems.
The caller can take the returned NSDraggingSession and continue to modify its properties such as slidesBackOnCancelOrFail. When the drag actually starts, the source is sent a draggingSessionWillBeginAtPoint message followed by multiple draggingSessionMovedToPoint messages as the user drags.
Once the drag is ended or cancelled, the source receives a draggingSessionEndedAtPoint:operation and the drag is complete.
Available in OS X v10.7 and later.
Some examples using this method:
NSViewMBS.compositingFilter as variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa | MBS MacBase Plugin | 18.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This property contains the compositing filter stored in the compositingFilter property of the view’s layer. If the view does not have a layer, setting the value of this property has no effect.
The default value of this property is nil, which causes content to be rendered without any special compositing effects.
We use variant here to reduce plugin dependencies. Please use with variant containing CIFilterMBS.
(Read and Write computed property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 8.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
On success the handle property is not zero.
See also:
NSViewMBS.Constructor(Handle as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 8.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
The handle is casted to a NSView and the plugin retains this handle.
See also:
NSViewMBS.Constructor(left as Double, top as Double, width as Double, height as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
On success handle is set.
For a toolbar, please get the view directly: self.NSToolbarMBS.toolbarView.
See also:
NSViewMBS.contentFilters as variant()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 18.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This property contains an array of CIFilterMBS objects. This array represents the filters stored in the filters property of the view’s layer. If the view does not have a layer, setting the value of this property has no effect.
The default value of this property is an empty array.
We use variant here to reduce plugin dependencies. Please use with array of variants containing CIFilterMBS.
NSViewMBS.convertPointFromView(point as NSPointMBS, View as NSViewMBS) as NSPointMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 10.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
point: A point specifying a location in the coordinate system of aView.
View: The view with aPoint in its coordinate system. If View is nil, this method instead converts from window base coordinates. Otherwise, both View and the receiver must belong to the same NSWindow object.
Returns the point converted to the coordinate system of the receiver.
Some examples using this method:
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Database with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Simple Demo with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListboxTV with ContainerControl Cells
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
NSViewMBS.convertPointToView(point as NSPointMBS, View as NSViewMBS) as NSPointMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 10.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
point: A point specifying a location in the coordinate system of the receiver.
View: The view into whose coordinate system point is to be converted. If View is nil, this method instead converts to window base coordinates. Otherwise, both View and the receiver must belong to the same NSWindow object.
Returns the point converted to the coordinate system of View.
NSViewMBS.convertRectFromView(rect as NSRectMBS, View as NSViewMBS) as NSRectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 10.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
rect: The rectangle in aView's coordinate system.
view: The view with aRect in its coordinate system. If view is nil, this method instead converts from window base coordinates. Otherwise, both view and the receiver must belong to the same NSWindow object.
Returns the converted rectangle.
NSViewMBS.convertRectToView(rect as NSRectMBS, View as NSViewMBS) as NSRectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 10.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
rect: A rectangle in the receiver's coordinate system.
View: The view that is the target of the conversion operation. If View is nil, this method instead converts from window base coordinates. Otherwise, both View and the receiver must belong to the same NSWindow object.
Returns the converted rectangle.
Some examples using this method:
NSViewMBS.convertSizeFromView(Size as NSSizeMBS, View as NSViewMBS) as NSSizeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 10.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Size: The size (width and height) in aView's coordinate system.
View: The view with Size in its coordinate system. If View is nil, this method instead converts from window base coordinates. Otherwise, both View and the receiver must belong to the same NSWindow object.
Returns the converted size, as an NSSize structure.
NSViewMBS.convertSizeToView(Size as NSSizeMBS, View as NSViewMBS) as NSSizeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 10.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Size: The size (width and height) in the receiver's coordinate system.
View: The view that is the target of the conversion operation. If View is nil, this method instead converts from window base coordinates. Otherwise, both View and the receiver must belong to the same NSWindow object.
Returns the converted size, as an NSSize structure.
NSViewMBS.dataWithEPSInsideRect(left as Double, top as Double, width as Double, height as Double) as Memoryblock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 8.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
NSViewMBS.dataWithPDFInsideRect(left as Double, top as Double, width as Double, height as Double) as Memoryblock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 8.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
See also:
NSViewMBS.dataWithPDFInsideRect(r as NSRectMBS) as Memoryblock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
See also:
NSViewMBS.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 | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 13.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Image: The NSImage object to be dragged.
viewLocation: The location of the image's lower-left corner, in the receiver's coordinate system. It determines the placement of the dragged image under the cursor. When determining the image location you should use the mouse down coordinate, provided in theEvent, rather than the current mouse location.
offset: This parameter is ignored.
NSEvent: The left mouse-down event that triggered the dragging operation (see discussion below).
pboard: The pasteboard that holds the data to be transferred to the destination (see discussion below).
source: An object that serves as the controller of the dragging operation. It must conform to the NSDraggingSource protocol and is typically the receiver itself or its NSWindow object.
slideBack: A Boolean that determines whether the drag image should slide back if it's rejected. The image slides back to imageLoc if slideBack is true and the image isn't accepted by the dragging destination. If false the image doesn't slide back.
This method must be invoked only within an implementation of the mouseDown or mouseDragged methods.
Before invoking this method, you must place the data to be transferred on pboard. To do this, get the drag pasteboard object (NSDragPboard), declare the types of the data, and then put the data on the pasteboard.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This method provides the shape of the focus ring mask by drawing the focus ring mask. An implementation of this method should draw in the view's interior (bounds) coordinate space, that the focus ring style has been set (it will be set it to NSFocusRingOnly to capture the focus ring itself), and that the fill and stroke colors have been set to an arbitrary fully opaque color.
Subclasses that find the default behavior insufficient should only draw the focus ring shape.
The NSView implementation of this method simply fills self.bounds.
Available in Mac OS X v10.7 and later.
NSViewMBS.enclosingMenuItem as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Value is a NSMenuItemMBS. We use variant to reduce dependency to other plugins.
Returns the menu item containing the receiver or any of its superviews in the view hierarchy, or nil if the receiver's view hierarchy is not in a menu item
Available in Mac OS X v10.5 and later.
NSViewMBS.enclosingScrollView as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Value is a NSScrollViewMBS. We use variant to reduce dependency to other plugins.
NSViewMBS.focusRingMaskBounds as NSRectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns a rectangle containing the mask in the view's interior (bounds) coordinate space.
The mask bounds allows the focus ring's overall size and position to be determined before it is drawn.
Subclasses must override this method if they require the display of a focus ring.
The NSView implementation of this method simply returns NSRectMBS.Zero.
Note: The information provided by focusRingMaskBounds will enable Accessibility to identify selected subelements for zoom tracking, so it is important that this method provide a reasonably tight bounding box and that noteFocusRingMaskChanged is invoked as described.
NSViewMBS.hitTest(x as double, y as double) as NSViewMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 24.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
x/y: A point that is in the coordinate system of the view’s superview, not of the view itself.
This method is used primarily by an NSWindowMBS object to determine which view should receive a mouse-down event. You’d rarely need to invoke this method, but you might want to override it to have a view object hide mouse-down events from its subviews. This method ignores hidden views.
NSViewMBS.isDescendantOf(view as NSViewMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 7.7 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
NSViewMBS.makeBackingLayer as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Value is a CALayerMBS. We use variant to reduce dependency to other plugins.
Available in OS X v10.6 and later.
NSViewMBS.nextValidKeyView as NSViewMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This method ignores hidden views when it determines the next valid key view.
Returns nil on any error.
NSViewMBS.noteFocusRingMaskChanged
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
It is important to note that it is only necessary for developers to invoke this method when some internal state change of their application, that the Application Kit can't determine, affects the shape of the focus ring mask.
It is assumed that if the view is marked as needing display, or is resized, its focus ring shape is likely to have changed, and there is no need for clients to explicitly send this message in such cases, they are handled automatically.
If, however, a view is showing a focus ring around some part of its content (an NSImage, perhaps), and that content changes, the client must provide notification by invoking this method so that focusRingMaskBounds and drawFocusRingMask will be invoked to redraw the focus ring.
Available in Mac OS X v10.7 and later.
Some examples using this method:
NSViewMBS.pageFooter as NSAttributedStringMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 12.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
A printable view class can override this method to substitute its own content in place of the default value. You should not need to call this method directly. The printing system calls it once per page during printing.
Footers are generated only if the user defaults contain the key NSPrintHeaderAndFooter with the value true.
NSViewMBS.pageHeader as NSAttributedStringMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 12.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Typically, the print job title is the same as the window title. A printable view class can override this method to substitute its own content in place of the default value. You should not need to call this method directly. The printing system calls it once per page during printing.
Headers are generated only if the user defaults contain the key NSPrintHeaderAndFooter with the value true.
NSViewMBS.previousKeyView as NSViewMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This view should, if possible, be made first responder when the user navigates backward from the receiver using keyboard interface control.
Returns nil on any error.
NSViewMBS.previousValidKeyView as NSViewMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This method ignores hidden views when it determines the previous valid key view.
Returns nil on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 12.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
NSViewMBS.registeredDraggedTypes as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This method returns the types registered by calling registerForDraggedTypes:. Each element of the array is a uniform type identifier. The returned elements are in no particular order, but the array is guaranteed not to contain duplicate entries.
NSViewMBS.registerForDraggedTypes(Types() as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Types: An array of uniform type identifiers. See Types for Standard Data (Mac OS X 10.6 and later) for descriptions of the pasteboard type identifiers.
Registering an NSView object for dragged types automatically makes it a candidate destination object for a dragging session. As such, it must properly implement some or all of the NSDraggingDestination protocol methods. As a convenience, NSView provides default implementations of these methods. See the NSDraggingDestination protocol specification for details.
Xojo with Cocoa target implements the methods listed above. So this method is useful to change the allowed types for the case the framework has a bug.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Some examples using this method:
NSViewMBS.removeFromSuperviewWithoutNeedingDisplay
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The receiver is also released; if you plan to reuse it, be sure to retain it before sending this message and to release it as appropriate when adding it as a subview of another view.
Unlike its counterpart, removeFromSuperview, this method can be safely invoked during display.
Some examples using this method:
The items on this page are in the following plugins: MBS MacBase Plugin.
