drag-and-drop between ListCtrls in 2.9/Cocoa

One of my interfaces allows dragging of items from one list control to another. The attached sample shows how it works - select any item in the left-hand list, drop it on the right-hand list, and it is added there. This functions well on both Mac and Linux with wxPython 2.8.12.1, but not on Mac with wxPython 2.9.2.* and the wxOSX-Cocoa backend. I can still start to drag an item, but dropping it has no effect. Is this a bug, or am I missing an API change?

(FYI, I also don’t see the focus highlight for either list in 2.9/Cocoa - not sure if that’s related or not.)

thanks,

Nat

wx_listdrop.py (1.85 KB)

One of my interfaces allows dragging of items from one list control to
another. The attached sample shows how it works - select any item in
the left-hand list, drop it on the right-hand list, and it is added
there. This functions well on both Mac and Linux with wxPython
2.8.12.1, but not on Mac with wxPython 2.9.2.* and the wxOSX-Cocoa
backend. I can still start to drag an item, but dropping it has no
effect. Is this a bug, or am I missing an API change?

There are some problems in wxOSX-cocoa related to DnD, see wxTrac has been migrated to GitHub Issues - wxWidgets. While using drop targets with the stock data types seems to be working better in the trunk, there is still seems to be problems using custom data types...

(FYI, I also don't see the focus highlight for either list in 2.9/Cocoa
- not sure if that's related or not.)

No. By default the generic ListCtrl class is used and it does not have focus ring support.

···

On 10/31/11 3:47 PM, Nat Echols wrote:

--
Robin Dunn
Software Craftsman

Hmm. Is there a way to do what I want without using custom data types? All I really need to know is the indices of the dragged list items - the actual list data can be extracted directly once those are available, instead of using the custom data types. (I’ve never actually used drag-and-drop in any other situation except to load files from the desktop.)

thanks,

Nat

···

On Mon, Oct 31, 2011 at 7:40 PM, Robin Dunn robin@alldunn.com wrote:

There are some problems in wxOSX-cocoa related to DnD, see http://trac.wxwidgets.org/ticket/12853. While using drop targets with the stock data types seems to be working better in the trunk, there is still seems to be problems using custom data types…

You might be able to get by with a wx.TextDataObject, but that would open it up to any application that does DnD of text...

···

On 11/1/11 6:50 AM, Nat Echols wrote:

On Mon, Oct 31, 2011 at 7:40 PM, Robin Dunn <robin@alldunn.com > <mailto:robin@alldunn.com>> wrote:

    There are some problems in wxOSX-cocoa related to DnD, see
    wxTrac has been migrated to GitHub Issues - wxWidgets
    <wxTrac has been migrated to GitHub Issues - wxWidgets. While using drop targets
    with the stock data types seems to be working better in the trunk,
    there is still seems to be problems using custom data types...

Hmm. Is there a way to do what I want without using custom data types?
  All I really need to know is the indices of the dragged list items -
the actual list data can be extracted directly once those are available,
instead of using the custom data types. (I've never actually used
drag-and-drop in any other situation except to load files from the desktop.)

--
Robin Dunn
Software Craftsman