Archive: ExecDos and cancel/close (x) buttons


ExecDos and cancel/close (x) buttons
Hello everyone,

Is it somehow possible to terminate the thread created by ExecDos::exec when the user clicks on the cancel button?

I am using ExecDos::exec to run a perl script that installs some packages from CPAN and displays the progress from console in a multi-line text window. Since the installation can take several minutes, I would like to give the user the opportunity to stop the installation.

I can disable next, back and cancel buttons, but weird things happen also when I use the 'x' in the corner of the installer to close it (and I think that some users might try that if all the other buttons are disabled).

I was also thinking about creating a separate installer for the CPAN packages installation, is there any other function that respects the cancel button? (I've looked at nsExec documentation but haven't found anything useful yet)

Thank you for any suggestions.


Stopping in the middle of a Perl script? Is that a good idea? Also why isn't the X button disabled? You're not running your script in a section? This is generally bad practice - the machine should not be touched in any way until the sections are executed. If that is unavoidable the X button can also be disabled (http://forums.winamp.com/showthread.php?t=322433).

Stu


But to answer your question regarding the Cancel button telling ExecDos to kill its thread; will that even work assuming you could (you can't)? Your Perl script will carry on regardless. You could have some UI for your Perl script with a cancel button on it but I realise that isn't pretty. There isn't really any other way.

Stu