Cocoa Problem

I have an application I would very much like to compile to Cocoa, for several reasons.

The problem has to do with dragging a canvas sub-class around on a canvas, and dragging the same object while it it ‘selected’, in which case the sub-class loses it’s drop position and goes to the main canvas’ corner - 0, 0, if Cocoa.

I use a ‘Do…Loop until not obj.nextitem’ to iterate through the objects on the canvas in the DropObject event handler, and when one (or more) is selected, it takes an extra loop, which doesn’t seem to matter with Carbon, but is apparently a problem with Cocoa.

I have written a simple test application and compiled it for both Carbon and Cocoa, and uploaded the 2.7MB file containing the code, written in Xojo 2014 r.2.1 (which is the last version that will compile to Carbon) and the compiled apps, in the hope that I could get some help with it.

Thank you!

That seems like a unique way to use DragItems. :slight_smile:

Have you considered just doing all the dragging within the Canvas itself and not using DragItem at all? These two examples should give you an idea:

Examples/Graphics and Multimedia/CanvasDrawDrag
Examples/Graphics and Multimedia/ObjectsInCanvas

Thank you, Paul.

Sorry to be so late responding, but I don’t even see my post on the Forum. Had to go to my account/activity to find it.

I’ll work on your suggestions. They are much appreciated.