I have an application, which is primarily for presenting documents but can under certain circumstances also change the presented document. That's why my app isn't a real document based app.
Nevertheless I want to display the "— Edited" additive to my window title, when the document has been edited and the changes weren't saved yet.
Therefore I have to methods in my AppDelegate
@objc func didEditDocument(_ notification: Notification) {
myMainWindow.windowController?.setDocumentEdited(true)
}
@objc func didSaveDocument(_ notification: Notification) {
myMainWindow.windowController?.setDocumentEdited(false)
}
I was expecting my window title to change from MyWindow
to MyWindow — Edited
after calling .setDocumentEdited(true)
, but that didn't happen. But the dot in the red close button changes. What am I doing wrong?