NSDraggingImageComponent Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.7 and later. |
| Companion guide | |
| Declared in | NSDraggingItem.h |
Overview
The NSDraggingImageComponent class represents a single object in a dragging item.
An array of NSDraggingImageComponent instances are composited together to create the dragging image for an NSDraggingItem. NSDraggingImageComponent instances can simply be considered as named images with a location used by an NSDraggingItem instance.
See NSDraggingItem Class Reference for more information.
Tasks
Creating a Dragging Image Component
Dragging Image Component
-
keyproperty
Dragging Image Contents
Properties
contents
An object providing the image contents of the component.
Discussion
Typically you set an NSImage instance or a CGImageRef as content.
Availability
- Available in OS X v10.7 and later.
Declared In
NSDraggingItem.hframe
The coordinate space is the bounds of the parent dragging item.
Discussion
The frame is {{0,0}, {draggingFrame.size.width, draggingFrame.size.height}}.
The coordinate space is the bounds of the parent NSDraggingItem instance’s draggingFrame.
Availability
- Available in OS X v10.7 and later.
See Also
-
draggingFrame(NSDraggingItem Class)
Declared In
NSDraggingItem.hkey
The unique name of this image component instance.
Discussion
The key must be unique for each component in an NSDraggingItem instance. You can create your own named components, however the keys described in “NSDragImage Component Keys” have special meanings.
When an NSDraggingItem instances imageComponents are changed by one of the enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock: methods the image associated with this key is morphed into the new image component’s image associated with the same key.
Availability
- Available in OS X v10.7 and later.
Declared In
NSDraggingItem.hClass Methods
draggingImageComponentWithKey:
Creates and returns a dragging image component with the specified key.
Parameters
- key
The key.
Return Value
A dragging image component with the spiced key.
Availability
- Available in OS X v10.7 and later.
Declared In
NSDraggingItem.hInstance Methods
initWithKey:
Initializes and returns a dragging image component with the specified key.
Parameters
- key
The key.
Return Value
An initialized dragging image component with the specified key.
Discussion
This method is the designated initializer.
Availability
- Available in OS X v10.7 and later.
Declared In
NSDraggingItem.hConstants
NSDragImage Component Keys
These constants are used by the initWithKey:, draggingImageComponentWithKey: methods and the key property.
NSString * const NSDraggingImageComponentIconKey; NSString * const NSDraggingImageComponentLabelKey;
Constants
NSDraggingImageComponentIconKeyKey with a corresponding value that is an image of the item being dragged.
Available in OS X v10.7 and later.
Declared in
NSDraggingItem.h.NSDraggingImageComponentLabelKeyKey with a corresponding value that represents a textual label associate with the item, for example, a file name.
Available in OS X v10.7 and later.
Declared in
NSDraggingItem.h.
© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-06-11)