using wxperl I want to start a long-lasting function after dragging files to my window. Here is my code for the DropTarget:
package FilesDropTarget;
use strict;
use Wx qw[:allclasses];
use base qw(Wx::FileDropTarget);
sub new {
my $class = shift;
my $caller = shift;
my $fref = shift;
my $this = $class->SUPER::new( @_ );
$this->{caller} = $caller;
$this->{fref} = $fref;
return $this;
}
sub OnDropFiles {
my( $this, $x, $y, $files ) = @_;
&{$this->{fref}}($this->{caller},@$files);
return 1;
}
This module is used via
$frame->{TextControl}->SetDropTarget( FilesDropTarget->new($frame,\&runner) );
(OnDropFiles calls the function &runner() with the dropped files as parameter.)
Everything is fine, except that the drag-source window on Windows is blocked while function &runner() is working, which potentially is a long-lasting operation. The drag-source window becomes useable again after OnDropFiles
returns 1, hence after &runner() is ready.
Are there chances to get the drag-source unblocked before &runner() has been finished?