$file $x $y are three undefined variables -- wx will complain
This works for me on windows
$frame->DragAcceptFiles(1); EVT_DROP_FILES( $frame, \&doit ); sub doit { warn "@_\n" }
Why that?
Also for reference :) my wxWidgets / wxPerl / wxGlade tutorial and there also exists https://github.com/jmlynesjr/wxPerl-wxBook-Examples/ and it probably has drag drop example, just like wxperl_demo --show "Drag and drop"
Also, interleaving code and subs is bad :)
see Re: No such file or directory error/No such file or directory error, see template at (tye)Re: Stupid question (and see one discussion of that template at Re^2: RFC: Creating unicursal starsuse ... Main( @ARGV ); exit( 0 ); ... sub
Another thing i am trying to figure out is how to share a variable from a subroutine and pass it to print in the listbox?
What "subroutine", what variable where and for what purpose? The same principles apply to wxPerl, see write Tk callbacks all lexically scoped and not-memory leaking with no nested subs ever :) avoid nested subs and closures because nested named subs because they're closures
You register event handlers UPON widget objects (wxWindow a wxObject), so each event handler gets as first argument that wxObject ... there is even a global Wx::wxTheApp() which you can also use as a stash (better if the frames keep track of their own data) ... more words and/or more code gets more clear answer
In reply to Re: WxPerl and drag and dropping files
by Anonymous Monk
in thread WxPerl and drag and dropping files
by james28909
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |