how best to use IgorStartOrNewHook
Mon, 04/27/2020 - 03:22 am
IgorStartOrNewHook allows Igor to do something after startup.
If the user starts Igor, the thing is done, all is fine.
But if the user starts Igor by double-clicking a pxp file, Igor starts, and runs the hook function before opening the experiment. Any non-modal thing I want to do is seemingly not possible.
It would be ideal to wait until the experiment is opened, and then run some code. But I can't see how to do that.
I could perhaps use IgorBeforeQuitHook to prevent the experiment being opened and allow the non-modal thing to happen. IgorStartOrNewHook sets a global variable with an expiry time, IgorBeforeQuitHook reads the variable, kills it, and returns 1 if the variable was recently set. But then the user is left without their experiment opened.
What am I missing? Is there some way to know that an experiment load is pending, and ideally to run some code after the experiment is reloaded?
Maybe there's a method using AfterCompiledHook and checking for uptime?