NSWindow with round corners and shadow

Update I realised old approach was not able to create precise round corner. So I updated example to make precise round corner. window1.backgroundColor = NSColor.whiteColor() window1.opaque = false window1.styleMask = NSResizableWindowMask | NSTitledWindowMask | NSFullSizeContentViewWindowMask window1.movableByWindowBackground = true window1.titlebarAppearsTransparent = true window1.titleVisibility = .Hidden window1.showsToolbarButton = false window1.standardWindowButton(NSWindowButton.FullScreenButton)?.hidden = true window1.standardWindowButton(NSWindowButton.MiniaturizeButton)?.hidden = true window1.standardWindowButton(NSWindowButton.CloseButton)?.hidden = … Read more

Keep window always on top?

To change the window level you can’t do it inside viewDidload because view’s window property will always be nil there but it can be done overriding viewDidAppear method or any other method that runs after view is installed in a window (do not use it inside viewDidLoad): Swift 4 or later override func viewDidAppear() { … Read more

NSWindow with NSWindowCollectionBehaviorStationary is visible on the Dashboard. Is this a bug?

I looked at http://cocoadev.com/wiki/DontExposeMe searching for workaround nothing really worked except. self.window.level = kCGDesktopWindowLevel; now maybe DETECT changes to expose and set that then 🙂 … see How can one detect Mission Control or Command-Tab switcher superseding one’s program in OS X? for that 🙂 maybe an answer will come up there

How do I create a Cocoa window programmatically?

The problem is that you don’t want to call display, you want to call either makeKeyAndOrderFront or orderFront depending on whether or not you want the window to become the key window. You should also probably use NSBackingStoreBuffered. This code will create your borderless, blue window at the bottom left of the screen: NSRect frame … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)