Makesecret upon closing last window

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?

Thanks,

– Mark

Short Answer: This is not 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.

No need for this gyration – you can just use the maksecret statement.

it may be possible to simulate

The problem is that if the user clicks the close button of the window (the red circle) the database will close – there is no way to override this.

However, you can make a custom library, so that would be one way to accomplish this.

Would you give me a breadcrumb or three on how this would work?
I’m assuming the library would be a “Panorama” library, not a c/obj-c library, right?

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:

Woo hoo! Lots of breadcrumbs.

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! :wink::slightly_smiling_face:

I was just now going thru the list of bugs/suggestions and discovered that this was already on the list!

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.

1 Like

@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.

@mdj if you hold off a short while, you’ll be able to do this instead of having to use a library.

1 Like

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!

You are the second person to tell me that this week! (seriously, you really are)