dk / Prima

prima.eu.org
Other
108 stars 27 forks source link

how can i get drag folder path use prima::inputline on my win7 #103

Closed StevenCoober closed 9 months ago

StevenCoober commented 9 months ago

use Encode; use Prima qw(Application); use Prima::MsgBox qq(input_box message); use Prima qw(Edit InputLine Application); use Proc::ProcessTable; $w = Prima::MainWindow->new( text => "node", size => [ 300, 350], centered => 1, ); $projectinput = $w->insert( 'Prima::InputLine', text => decode("gbk", ''), pack => { fill => 'x', side => 'top', pad => 10 }, dndAware => 1, onDragBegin => sub { my ($self, $clipboard, $action, $modmap, $x, $y, $ref) = @; my $string = $clipboard-> text; my $image = $clipboard-> image; print("how can i get drag folder path on my win7"); }

); run Prima;

StevenCoober commented 9 months ago

can anyone help me?

dk commented 9 months ago

There seems to be something fishy with the whole DND in windows, I just tried every small program I could find, including notepad.exe, to accept drop files from the file explorer and it just doesn't work. IT looks like this is could be security-related?

https://www.elevenforum.com/t/drag-and-drop-while-running-as-admin.16916/

Not even the simples DND example from here https://github.com/alexGuntha/mindragndropwin cannot work with explorer. Very. very strange

dk commented 9 months ago

I hacked this, https://github.com/dk/Prima/commit/04a115c5e571ddea5b368507f7a9d6acffc1cf89, try to see if that helps you though - I got it working on an old emulated windows 7

StevenCoober commented 9 months ago

Thanks a lot for your quick response and the fix 😊

StevenCoober commented 9 months ago

It works for me on my old win7 😊

dk commented 9 months ago

shall we close the issue then?

StevenCoober commented 9 months ago

yes