IB / Xcode style drag and drop arrows (between windows)

Hi all,
Looking for suggestions please on how to implement a “drag and drop line+arrow between windows” style feature. I have a list box on one window and I want to be able to click and drag a line from that list to another list listbox in a separate window. You can see the sort of thing if you use Xcode Interface builder and ctrl-click-drag from a UI element… You can drag an arrow to another window. How to I draw that line outside the window???

The idea I have so far it so throw up a transparent background window across the entire screen when the user starts the drag and then draw the line until mouseUp. That all seems inefficient and like I might be missing something / some trick.

If you are talking about two windows that do not share a common container… then it really can’t be done, as you have no idea who owns the “space” between the windows.
However, if by “windows” you mean two sections of the same screen (like the library/inspector vs the code editor pane in the ide)
then one way would be to add a LINE object, and manipulate its visible and coordinate properties.

I can see 2 ways to do this

  1. The way you described, a single transparent window on top that you draw into. pro: offers the greatest flexibility as you can draw the arrow arc any way you want. con: requires declares for each platform. support for multiscreen?

  2. Use 2 thin plainbox windows to create horizontal and vertical arms of the arrow, the way IB does. pro: possibly can be done in pure xojo. should work multiscreen. con: less control of the look of the arrow.

Both options may need declares anyways to keep the windows on top. Personally I’d go with #1 and profile it to see how expensive it actually is then weigh that against how much time this feature will be in action.

Thank for the replies. I did a quick app that implements option 1. Seems to work well so far. I can live with not supporting dragging across multiple screens, and I do detect which screen the drag-start is on so it positions the transparent window correctly.
I have some work to do to clearly indicate the drop-zone on the destination window, but so far so good.

If it doesn’t work out I think I’ll go with an option as per the Xojo ListBoxDragBetweenCells example…

Will post back on how it all ends up.