Hide NSWindow header background, e.g. Messages.app

I am relatively new to developing OS X (from iOS).

How can I archive a similar window like in a messaging app for OS X?

I think I should subclass NSWindow and override something? Any idea what?

Messages.app

OS X Yosemite is the goal of deployment. No need to support an older OS.

+5
source share
2 answers

Ok, I found a solution. You must subclass NSWindowController and in the windowDidLoad method, you must put this code:

 self.window!.titlebarAppearsTransparent = true 

for this to work, you need to activate the "Full Content Size" in the "Interface Builder".

+10
source

titlebarAppearsTransparent is available in OS X 10.10.

For OS X 10.9 and below,

set window.backgroundColor and add NSTexturedBackgroundWindowMask to the style mask.

+3
source

Source: https://habr.com/ru/post/1207935/


All Articles