A Few Questions
Ken
I ran into a few problems while working on my code.
1. Is there a way to easily find the coordinates of a window?
2. How do you make an experiment perform some preset actions upon closure, such as resetting certain waves within the root folders or deleting the command history?
3. Can a user make it so someone using an experiment cannot see/alter the code in the experiment procedure window?
4. I currently have the following code to disable saving on my program because I would like users to save using other methods. Is this how you would go about doing so?
SetIgorMenuMode "File", "Save Experiment", DisableItem
SetIgorMenuMode "File", "Save Experiment As", DisableItem
SetIgorMenuMode "File", "Save Experiment Copy", DisableItem
SetIgorMenuMode "File", "Save Experiment As", DisableItem
SetIgorMenuMode "File", "Save Experiment Copy", DisableItem
Is there a way to stop Igor from prompting you to save changes when closing an experiment? And what is the difference between save experiment as and save experiment copy?
Any help would be much appreciated. Thank you.
The GetWindow operation.
The IgorQuitHook function:
Yes.
Your method should work fine. You might also look at the ExperimentModified operation.
With Save As, the saved experiment becomes the current experiment, and further changes to the experiment will be saved into that experiment.
With Save Copy, the saved experiment is a "snapshot" of the current experiment, but further changes don't affect that copy, only the open experiment.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
October 17, 2011 at 02:54 pm - Permalink
variable unsavedExp, unsavedNotebooks, unsavedProcedures
unsavedExp = 1 // Skipping prompting save
return unsavedExp
end
For making the procedural file invisible in #3, I split up my code into two files: one an ipf that went into user procedures that consisted of the main code, and the other a short procedure file that simply calls that ipf. Since files called with #include are automatically write-protected, #pragma hide=1 applied to it. The reason I did it this way was because I had difficulties making the original procedural file write-protected or read-only. Whenever I clicked on the pencil icon to write-protect the procedure and reopened the experiment, the write-protection would disappear.
Everything else worked.
October 22, 2011 at 03:43 pm - Permalink
Write-protect is an Igor setting and is not stored with the file. Read-only is an OS setting.
Make it read-only in the Windows desktop. Right-click the file, choose properties, and click the Read-Only checkbox.
October 22, 2011 at 06:04 pm - Permalink