develooper Front page | perl.tcltk | Postings from September 2018

[macOS] Tcl::pTk Drag&Drop

Thread Next
From:
welle Ozean via tcltk
Date:
September 21, 2018 11:01
Subject:
[macOS] Tcl::pTk Drag&Drop
Message ID:
CAL0NCLuWHnhbs1xOA0xqp+HoP44s0aRiHx_9S4KiSUTNqBTkGQ@mail.gmail.com
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

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About