DragToFinder Example Dest not working


I’m testing the DragToFinder Xojo example and try to figure out how DragItem.Destination works (On Mac).

When testing it DragItem.Destination never seems to be set to a a folderitem… Am I missing something?

From the example project:

[code] Dim di As DragItem
Dim f As FolderItem
Dim d As Date
Dim tos As TextoutputStream

d = New Date
f = SpecialFolder.Temporary.Child(“test” + Format(d.TotalSeconds, “#”))
If f <> Nil Then
tos = TextOutputStream.Create(f)
tos.Write(“Howdy! Created by DragToFinder example.”)

di = New DragItem(Self, 0, 0, 100, 100)
di.FolderItem = f 
If di.Destination <> Nil Then
  If di.Destination IsA FolderItem Then
  End If
End If

MsgBox(“Unable to get FolderItem for temporary file.”)
End If[/code]

please don’t post code out of context. what method or event is this in?

Looks like this Cocoa bug: <https://xojo.com/issue/21991>

Dave: Sorry but it is just code from an Xojo example.

Paul: Thanks, there seems to work arounds:

In the Feedback case this is noted: (Posting here for convenience.)

Thomas Tempelmann on 30 maj 2013 at 14:54
MacOSLib (since today) has a new CarbonDragManager class and comes with an Example that demonstrates how to solve this for now.

Christian Schmitz on 27 sep 2013 at 22:55
I wonder how to get the destination in Cocoa in objective-C. We have a lot of drag and drop things for Cocoa in the MBS Plugins, so it could be easy to add to the plugin as a workaround.