App.OpenDocument

I added code in there so that if someone double clicks my data file then it will open it in my app.

But then when they do a FileClose… it closes the main window.

If you open a window with OpenDocument does it automatically close on its own bc
I did not add code for it to close the window just the data file.

I assume FileClose refers to the “Close” item in the “File” menu?

That’s not there by default so you must have added it, and probably added a menu handler for it too that issues a Self.Close.

Yes it is a close item on File menu but I do not have a self.close in there. They have to exit the program to get the main window to go away. That’s why I can’t figure out why it’s disappearing. Anyway I will keep looking at it.

As an experiment, I stared a new project and added FileClose to make sure Xojo isn’t handling it automatically. It’s not.

Do you have Application.AutoQuit set to true?

Last Breaking News:

Three hours ago, I wanted to add code to a Print to PDF button. All I was able to do was to copy paste one example of code from developer.xojo.com.

BUT: I removed two bugs from two different projects.

I was uable to concentrate my mind on what I wanted to do; I was restrained to what my mind wanted to do (it had working hard to squash those two bugs and believed it was time to commit them…)
:wink:

Yes.

I just tried setting it to False and it had no effect. The main window still closes but the app exe process still remains in memory as I see it in the Processes list on Windows.

If you have AutoQuit set to true, the whole app closes too
If it is false the app remains running in memory.

This is ‘right’ for Mac, because there remains a menu bar where the user can select ‘New’ from file.
On WIndows, its wrongish as there is nothing the user can interact with.

The question is: if you only have one window open and someone closes it, what do you EXPECT will happen?
You could throw open a blank document?
You could ask ‘do you want to close the app’?

Sorry I’m probably not using precise terminology.

My application can open a “file” that has some data in it. They can edit the data and see graphs of the data.

When they do a “close” it closes that particular file but then opens another file containing some defaults.
And the app should remain open unless they do an exit. At that point they can do File Open or File New or manipulate the default data.

[quote=314167:@Jeff Tullin]This is ‘right’ for Mac, because there remains a menu bar where the user can select ‘New’ from file.
On WIndows, its wrongish as there is nothing the user can interact with.[/quote]

Does this happen with autoquit set to false or to true? Can’t tell from your answer.

i.e. what should I set autoquit to? Perhaps to True on Windows but False on the mac?

That would be normal.
Auto quit = true closes the app when there are no more windows.