Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Change Color of NSWindow Title Bar in OSX

Tags:

After a Long search regarding the NSWindow title bar color and title color, i have found a easy drawing solution. I posting this to share my knowledge.

like image 523
Muruganandham K Avatar asked Nov 16 '13 07:11

Muruganandham K


People also ask

How do I hide the title bar in OSX?

To remove the title bar, set the title bar's titleVisibility property to UITitlebarTitleVisibility. hidden and the toolbar property to nil.


1 Answers

There is a much easier way to do this. I've read that you can change a window's appearance to "textured" in a Storyboard / .xib file, but that doesn't work completely (titlebar color is mottled). However, you can change the color in your code with only two lines:

window.titlebarAppearsTransparent = true // gives it "flat" look
window.backgroundColor = <NSColor> // set the background color
like image 114
Sam Claus Avatar answered Sep 29 '22 09:09

Sam Claus