I seem to remember a discussion somewhere on how to keep a database open, yet secret, if the last window/form of the database is closed.
Was that with Panorama 6 and the “.CloseWindow” trigger – which I realize is no longer available in PanoX – or is there another method whereby this is possible in Panorama X?
Long Answer: Panorama’s library databases do this, but this is hard coded for libraries only. There’s no way to make a regular database do this. However, you can make a custom library, so that would be one way to accomplish this.
It may be possible to simulate this. IIRC procedures will run to completion even if the procedure database is closely along the way. So I think you should be able to write a procedure within a database which closes that database including all its windows,. And then reopen it with a secret window. You wouldn’t be able to trigger it via the conventional MacOS ways of closing windows, but could trigger it via any of the normal ways PanX procedures are triggered. If you really wanted to hardcore simulate it you could replace the standard menus with custom ones and maybe could replace Apple’s Close Window menu with your procedure. I’ve not tried it but it shouldn’t be hard to test a rough version of it.
This is not well documented, but several people have figured it out from the one paragraph in this release note from 2016.
Here is the paragraph itself -
Now automatically loads custom statements from any databases found in `/Application Support/PanoramaX/Libraries/. You can put databases in that folder manually, or you can ask the View Organizer to create one for you with the Libraries>Open User Name Custom Statements command. Later you can re-open with the same command, or with the Open View dialog or Open View wizard. Once you’ve created a library this way you can’t close it, the only way to get rid of it is to shut down Panorama and move it out of the folder. Procedures that are to be used as custom statements must have all UPPER CASE names. They can optionally have a comment block at the top that identifies the parameters, if that is present, Panorama X will check the number of parameters when the statement is used.
Here are some previous discussions on the forum that may be helpful:
I’m already using a custom library, I just did not realize that it could not be removed without restarting panorama.
I will have to double check, but I believe I have inadvertently closed my library database file, and it did actually disappear from the “memory usage“ window.
Thank you for taking the time to pull this stuff up!
I have not been following this too closely, as I have been busier as things open up, but I just recalled that I have been doing something like this with a couple of my files, and it works even if I use the close button. The thing to remember is that if you close a file, it will not close whatever is showing up in another file. So all you have to do, is whenever you need something from the file that you want to be secret, you check that the file is open. If it is not, then you open it as a secret file. This can be done automatically in the object or procedure that uses the secret file.
@BruceDeB it was actually a post from you that was the cause of this getting added to the Bitbucket list in the first place. I have just now gone ahead and added this feature to Panorama X 10.2. You can enable it in the Database Options panel or using the setdatabaseoptions statement.
One of these days, I will get around to using all the great tips you gave me, but I am so swamped by everything else… The further I get past retirement age, the more work it seems I have to do!