I created a wxStaticBitmap control and executed the following code when handling the wxEVT_MOTION message.
wxFileDataObject fileDataObj;
fileDataObj.AddFile(wxT("/usr/local/bin/test"));
wxDropSource dragSource(this);
dragSource.SetData(textDataObj);
dragSource.DoDragDrop();
This method cannot add an executable file to the "Full Disk Access" list in System Preferences.
The dnd sample program also cannot drag nodes from the file system tree to the "Full Disk Access" list.
How should I implement the drag source? Thanks!
--
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
---
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wx-users+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/wx-users/ce2b7ad8-6b58-48be-a30a-9779052450adn%40googlegroups.com.
The above task cannot be accomplished using wxFileDataObject. I found that the following code works, but I'm not sure if this usage is correct?
wxCustomDataObject customData(wxDataFormat(wxT("public.file-url")));
wxString wxsFileUrl = wxT("/usr/local/bin/test");
customData.SetData(wxsFileUrl.length(), wxsFileUrl.data());
wxDropSource dropSource(this);
dropSource.SetData(customData);
dropSource.DoDragDrop();