The NSWindowRestoration protocol defines the method that restoration classes must implement to handle the recreation of windows.
Questions tagged [nswindowrestoration]
8 questions
8
votes
3 answers
NSWindow restorable not always working
I have checked the restorable option on my NSWindow
When I move my application and change its size and close/reopen my application it sets the window size and position to the last size and position
but this doesn't happen on every computer where i…

Andy Jacobs
- 15,187
- 13
- 60
- 91
5
votes
1 answer
Restoring the selection in an NSTableView (NSWindowRestoration)
I'm working on window restoration in a non-document-based Cocoa app. The app has a Mail.app-like interface. Each window represents an account; a sidebar in that window lists conversations in that account, and a main area lists messages in the…

Becca Royal-Gordon
- 17,541
- 7
- 56
- 91
4
votes
2 answers
How do you restrict the macOS windowing management from restoring a specific window?
I have an app that has a few windows defined as a windows group in the structure conforming to App in the main scene:
WindowGroup("StandingsView") {
StandingsView()
.environmentObject(appServices)
}
.handlesExternalEvents(matching:…

Scott
- 1,034
- 1
- 9
- 19
4
votes
2 answers
Initial NSWindow size as percentage of screen size
I would like to set my NSWindow size as a function of the screen size.
There is an option in Interface Builder to set it in points, but not as a function of the screen size.
How can I set it programmatically as a default?
Note that I still want UI…

Yoav
- 5,962
- 5
- 39
- 61
2
votes
0 answers
Restoring nested NSDocuments
I am working on an Xcode-like IDE for MacOS. The IDE opens source files (instances of TextDocument) and has a separate project file (an instance of ProjectDocument that contains project settings. Both are subclasses of NSDocument.
When a source file…

Ronald
- 65
- 1
- 4
2
votes
2 answers
How to Persist Application State in cocoa
I need to store the state of application at application termination time, so that when user re-run app, App run from the state in which it was closed last time. It is some kind of restoring app but restore methods called when app close unexpectedly.…

Surjeet Singh
- 11,691
- 2
- 37
- 54
1
vote
1 answer
How to programmatically terminate NSApp without encoding window state?
All OS X application that support NSWindowRestoration can be closed by selecting the menu entry "Quit and Close All Windows" (Option-Command Q). This disables the state restoration and the next time you open the app all windows will be in their…

Klaas
- 22,394
- 11
- 96
- 107
0
votes
1 answer
NSDocument Tab Window Restoration
This question deals with tab window restoration in a document-based app.
In an OSX, document-based app, which allows a user to create and convert tab windows, I need to preserve and restore the 'tab' state of each window.
Currently, my document…

slashlos
- 913
- 9
- 17