Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide NSWindow titlebar background like Messages.app

I'm relative new to OS X development (coming from iOS).

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

I think I must create a NSWindow subclass and override something? Any idea what?

Messages.app

OS X Yosemite is the deployment target. No need to support older OS.

like image 855
Gustaf Rosenblad Avatar asked Nov 29 '14 15:11

Gustaf Rosenblad


2 Answers

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

self.window!.titlebarAppearsTransparent = true

to make the whole thing work, you have to activate "Full Size Content View" in Interface Builder.

like image 99
Palle Avatar answered Sep 24 '22 20:09

Palle


titlebarAppearsTransparent is available in OS X 10.10.

For OS X 10.9 and under,

set window.backgroundColor and add NSTexturedBackgroundWindowMask to style mask.

like image 40
devxoul Avatar answered Sep 23 '22 20:09

devxoul