0
使用wxperl我想在將文件拖到我的窗口後啓動持久功能。這裏是我的DropTarget的代碼:OnDropFiles啓動持久功能
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;
}
該模塊通過
$frame->{TextControl}->SetDropTarget(FilesDropTarget->new($frame,\&runner));
(OnDropFiles調用函數&亞軍()與被丟棄的文件作爲參數) 一切使用的很好,除了Windows的拖動源窗口被阻塞,而功能& runner()正在工作,這可能是一個持久的操作。拖動源窗口在OnDropFiles
返回1後變爲可用,因此在& runner()準備就緒後。
runor()完成之前是否有機會讓拖動源暢通無阻?
非常感謝您指點正確的方向! – leu