Cannot add TCC permission by dragging on macOS

54 views
Skip to first unread message

LIANG ZHOU

unread,
Nov 4, 2025, 5:04:59 AMNov 4
to wx-users

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!

Igor Korot

unread,
Nov 4, 2025, 8:40:25 AMNov 4
to wx-u...@googlegroups.com
Hi,

What’s you wx version?

Thank you.

--
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.

LIANG ZHOU

unread,
Nov 5, 2025, 2:57:55 AMNov 5
to wx-users

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();

Vadim Zeitlin

unread,
Nov 5, 2025, 11:51:18 AMNov 5
to wx-u...@googlegroups.com
On Tue, 4 Nov 2025 23:57:54 -0800 (PST) LIANG ZHOU wrote:

LZ> The above task cannot be accomplished using wxFileDataObject. I found that
LZ> the following code works, but I'm not sure if this usage is correct?

If it works, it probably is, i.e. I have trouble seeing what would be
wrong with doing it like this. But perhaps wxFileDataObject should provide
its data in this "public.file-url" format too... If you'd like to try to
modify its implementation in wxOSX to do it, please make a pull request
with your changes!

Thanks,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/

Stefan Csomor

unread,
Nov 7, 2025, 4:55:02 PMNov 7
to wx-u...@googlegroups.com
Hi

are you sure you copied the real code ? you set up a fileDataObj but set the drag to a textDataObj which would explain the problem as the fileDataObj should in wxDF_FILENAME which should be translated to kUTTypeFileURL

      wxFileDataObject fileDataObj;
     fileDataObj.AddFile(wxT("/usr/local/bin/test"));
     wxDropSource dragSource(this);
     dragSource.SetData( -> textDataObj <-);
     dragSource.DoDragDrop();

Best,

Stefan


Reply all
Reply to author
Forward
0 new messages