Check out NSWindow's setIgnoresMouseEvents: method. Also (in some versions of OS X, at least) this only affects click through to Cocoa apps; I overrode setIgnoresMouseEvents: in one of my NSWindow subclasses as follows so click through to Carbon apps worked too:
Code:
- (void)setIgnoresMouseEvents:(BOOL)clickThrough {
// carbon
void *ref = [self windowRef];
if (clickThrough)
ChangeWindowAttributes(ref, kWindowIgnoreClicksAttribute, kWindowNoAttributes);
else
ChangeWindowAttributes(ref, kWindowNoAttributes, kWindowIgnoreClicksAttribute);
// cocoa
[super setIgnoresMouseEvents:clickThrough];
}
(Remember to #import <Carbon/Carbon.h> if you do the override like this.)
FWIW, NSNonactivatingPanelMask just allows the panel to recieve keyboard input without activating the application.