NSWindow Snippets

by Matt Long

Here are some snippets to help with performing different tasks using NSWindow.

Window Characteristics

  • Create Borderless Transparent Window: Create a new class that inherits from NSWindow and override the method: – (id) initWithContentRect: (NSRect) contentRect styleMask: (unsigned int) aStyle backing: (NSBackingStoreType) bufferingType defer: (BOOL) flag

    Note: This technique allows you to give the user the perception that Core Animation layers are being drawn onto the desktop. It can also be used to create windows that appear to have non-rectangular shapes.