[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Mac::Dialogs questions



Paul DuBois <paul@snake.net> wrote on Fri, 27 Feb 1998 10:02:38 -0600
>2) If you create a dialog with MacDialog, display it, then hit command-period
>to terminate the script, the dialog box remains on screen.  Is there a
>way within a script to receive a notification that you've been aborted, so
>that some cleanup can be done?

Brian L. Matthews <blm@halcyon.com> wrote on Fri, 27 Feb 1998 09:34:15 -0800:
>If your dialog is an object (and it should be), make sure it has a DESTROY
>method:
[edited]
>sub DESTROY { $_[0]->close }
>When the script is terminated, all the extant objects are auto-DESTROYed as
>if they're going out of scope, so having a DESTROY method lets you clean up
>stuff (like open windows) the perl doesn't know about itself.

Chris Nandor <pudge@pobox.com> wrote Fri, 27 Feb 1998 11:36:17 -0500:
>Sure.  Use the END{} block.  Add this to Alan's GetData.pm:
>  END {dispose $dlg}
>That should do it.

This is an important issue for any 'Windows' type module where the
situation is bound to arise.

I find Chris's method works but Brian's doesn't.

Does anyone disagree?

Alan



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch