Using Tcl::pTk I am trying to implement Drag&Drop on macOS without success.
According to its documentation, Tcl::pTk should support it. This is what I
am trying now (slightly adapted from my version for Windows and Perl/Tk):
$MyWidget->DropSite(-dropcommand => [\&accept_drop, $tap], -droptypes =>
(['Local', 'tkdnd']));
sub accept_drop {
my ($tab) = @_;
my $filePath;
eval {
if ($^O eq 'MSWin32') {
$filePath = $tab->SelectionGet(-selection => $selection,
'STRING');
}
else {
$filePath = $tab->SelectionGet(-selection => $selection,
'FILE_NAME');
}
}
#DO THINGS with $filePath
}
I have downloaded a binary of tkdnd (libtkdnd2.8.dylib). How do I let
Tcl::pTk know of this library? Or there is any way to implement it without
adding new libraries (I am using the Tcl shipped with macOS).
Thanks
Welle