use strict; use Tk; use Tk::DropSite; my $mw = tkinit; my $txt = $mw->Text(-font, ['Lucida Sans Unicode', '8'], -height, 4, -width, 60)->pack(); my $drop = $txt->DropSite(-droptypes,'Win32', -dropcommand, [\&dropCmd, $txt]); MainLoop; sub dropCmd { my ($widget, $selection) = @_; my $filename = $widget->SelectionGet(-selection => $selection,'STRING'); if (defined $filename) { $widget->insert('end', $filename."\n"); } }