To clarify what I mean by the title, I'm currently working on an app that will visually notify users of an event and to make sure the users sees the notification, we use custom toast notifications. The thing that I've found often when searching for solutions online has been the use of NSUserNotification, which is not what I want. I need a custom notification that we can completely customize. An example of what I want is Microsoft Outlook's Reminders window
This window should remain completely separate from the main app and should always be visible, even when the other app is not. But if you click dismiss, the window should just go away and you can carry on doing what you were doing.
The key thing that this Reminders window does that I want and the main issue I'm having trouble finding the solution for is: if you click the red close button in the top left, this will not bring up the next window associated with the app.
This is particularly good because like outlook's "Dismiss" button, when a user clicks that, I don't want to bring up the full app, which is currently what my app does. lol, it's awful that I click dismiss on my toast notification and it brings the full app up!
To show you the issue I mean, if you open up any multi-window app (like Finder), and have 2 windows open (on a single screen), when you click the red button for one of them, the other window gets automatically selected
I've looked into the difference between main and key windows for an app, and how an NSWindow has various methods like isKeyWindow, canBecomeKey, makeKey(), becomeKey(), isMainWindow, makeMain(), etc, etc, and it seems that no matter how I close an app, that the lower-level logic of a Cocoa app will notify other windows in an app to become the main window again.
I've tried subclassing NSWindow and overriding the close() method, which if I make close() do absolutely nothing, then as expected, the all windows stay as they are when I click the red button.
I'm really not sure where to go from here and what to look at next. I feel like this shouldn't be THAT tough to figure out, but I'm stumped.