in reply to Re^7: WxPerl and drag and dropping files
in thread WxPerl and drag and dropping files

Use meaningful variable names ($this is traditional for instance ... the docs can't guess what varname you're using)

Don't use global variables, you already have $frame , the globalest of the global things of your GUI application and all you could need or want, use it for storage

Invoke methods like methods not functions

Like this

$frame->DragAcceptFiles(1); EVT_DROP_FILES( $frame, \&ondrop ); EVT_BUTTON( $frame, $ButExtract, \&onExtract ); ## its like ## EVT_BUTTON( $parent, $child, \&callback ); ## EVT_BUTTON( $parent, $child->GetId, \&callback ); ... sub ondrop { my( $frame, $wxDropFilesEvent ) = @_; my @files = $wxDropFilesEvent->GetFiles; $frame->{you_chose_these_files} = \@files; ## extract( $files[0] ); ## or whatever } sub onExtract { my( $frame, $extractBut ) = @_; my( $firstFile ) = @{ $frame->{you_chose_these_files} }; extract( $firstFile ); ... }

But dont get to comfortable because i will probably have more questions lol

I'm standing right now, but my laptop isn't high enough, so neck/back a little more stiff than usual ... still better than unadjustable hard dining room chair ... I'm done buying furniture :)