0
votes

Currently I am trying to create a standalone window which is triggered from pressing a drop down button in a status bar icon. I am able to create windows however I am unable to move, minimise or close the windwos and they have the missing red, oragne and yellow butons that are visible in Mac.

Any ideas how to fix?

Edit: to provide more details I am building a Status bar app. I have removed the default windows Views controller from Storyboard and create a new one to make up my "settings" Screen ( screenshot below) Window controller

  1. I use the following code to instantiate the window -

    let mainStoryboard = NSStoryboard(name: NSStoryboard.Name(rawValue: "Main"), bundle: nil) let myWindowController = mainStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "NewWindowVC")) as? NSWindowController window?.windowController = myWindowController

and it results in the screen with no red, yellow and green buttons Blank screenwhic isn't movable and doesn't have the buttons on it..

1
Perhaps provide details about how you're creating the window. Like, post code.Ken Thomases

1 Answers

1
votes

It sounds like you need an introduction to event & window handling under macOS. To get started try reading through the Cocoa Event Handling Guide and Windows Programming Guide which between them cover the principles of handling events and moving, resizing, closing windows in response. If you are opening "document" windows you might want to read Document-Based App Programming Guide for Mac as the document kit handles a lot of the mundane tasks. These are all found in Apple's Documentation Archive along with sample code, and many of these documents are referenced directly from the current API documentation.

Documentation Archive? All these are older guides and no longer being updated by Apple. You should check anything you read in them against the current API documents for the various classes, but the core hasn't changed a lot.

Another answer might reveal where Apple has hidden the up-to-date guides and sample code, but Apple's current documentation includes links back to these old ones...

If you fail to get your windows moving, closing etc. ask a new question showing your code and describing your problem and some will undoubtedly help you along.