dragImage

Typeproperty
DictionaryLCS
LibraryLiveCode Script
Syntax
set the dragImage to {empty | <imageID> }
get the dragImage
Summary

Reports the id of an image that should be used to represent the drag operation.

Introduced2.9
Changes

The order in which LiveCode searches for drag images was changed in version 3.5. Previously, the current stack was searched first, followed by the list of open stacks.

OSmac, windows
Platformsdesktop, server
Example
on dragStart
  set the dragImage to the id of image "Drag Image" of me
end dragStart
RelatedProperty: behavior, dragImageOffset
Message: dragStart, dragEnd
Description

The dragImage property specifies the id of an image used to represent a drag operation. The property is set by the source application in a dragStart handler.

The image is only looked up after completion of the dragStart handler in which it is set and so the image must persist for the lifetime of the operation. Typically, a control will want to use a pre-existing image object, or create a temporary object in dragStart that it deletes when it receives dragEnd.

LiveCode looks for the specified image in the following order:

  1. The stack of the current object's behavior (if applicable)
  2. The stack of the owner of the current object's behavior (if applicable) ...
  3. The stack of the current object's stack's behavior (if applicable)
  4. The current object's stack
  5. The current object's stack's mainstack (if a substack)
  6. The current object's stack's mainstacks substacks
  7. The list of open stacks, in order they were loaded