How to abort Igor quitting?
Thu, 11/21/2019 - 12:09 pm
I would like to abort Igor quitting under certain conditions.
I've looked into IgorBeforeQuitHook, IgorQuitHook, and BeforeExperimentSaveHook with no positive results. I've also tried to abort these functions but it gets to the end of them, asking for quitting afterward.
If there is no possible solution, please, let me know so I publish this at the Igor Pro Wish List forum. The easiest way to accomplish this, in my opinion, would be to add an extra return value to IgorBeforeQuitHook so that it aborts the quitting under, for instance, return value 2.
Why would I want such a feature? In my laboratory, there is some equipment that is controlled with Igor. However, certain commands need to be run before closing Igor to properly disconnect everything. Of course, this could be automated and implemented in IgorBeforeQuitHook but it requires an amount of time and effort that we don't have currently. Therefore, it is easier for us to check if everything is closed and otherwise impede the user to close Igor. It is true that it would pretty easy for almost any Igor user to find the function and disable it (unless it were invisible) but in any case, that effort will be always greater than close everything properly.