Skip navigation.
 
mlRe: How to do the opposite of global floating window
FROM : Andreas Mayer
DATE : Tue Dec 31 14:06:47 2002

Am Montag, 30.12.02 um 17:48 Uhr schrieb Joe Blowson:

> My goal is to have this window simply float over the desktop and under
> all other windows at all times. The user never needs to directly
> interact with this window.


Make it a borderless window, set its window level to
kCGDesktopWindowLevel and make it clickthrough.

   NSWindow* window = [super initWithContentRect:contentRect
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered
defer:NO];

   [window setBackgroundColor: [NSColor clearColor]]; // transparent
window

   [window setAlphaValue:1.0];    // we want our drawings to be opaque

   [window setOpaque:NO];

   [window setLevel: kCGDesktopWindowLevel];

   /* carbon */
   void *ref = [window windowRef];
   ChangeWindowAttributes(ref, kWindowIgnoreClicksAttribute,
kWindowNoAttributes);
   // to reset: ChangeWindowAttributes(ref, kWindowNoAttributes,
kWindowIgnoreClicksAttribute);
   /* cocoa */
   [window setIgnoresMouseEvents:YES];


bye.  Andreas.
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlHow to do the opposite of global floating window Joe Blowson Dec 30, 17:48
mlRe: How to do the opposite of global floating window Michael Latta Dec 30, 18:07
mlRe: How to do the opposite of global floating window Andreas Mayer Dec 31, 14:06