How to create a special Cocoa window ...

Could some kind soul explain to me, how to create the following GUI element:

A semi-transparent button that stays always on top of all other apps, and receives the mouse events when the user clicks on it, even though another app is the currently active one.
This should work even when powerpoint is in oresentation mode.

Or maybe someone can point me to some source code that shows an example?
Or point me to a different forum / newsgroup / mailing list?

Thanks a lot in advance.

Best regards,
Gabriel.

PS:
Eventually, I would like to have several of these buttons, without window decorations.

Message was edited by: GabrielZ

MacBook Pro, Mac OS X (10.5.6), iPhone 2G w/ 2.1 FW, iTunes 8.0.1

Posted on Mar 11, 2009 4:15 AM

Reply
8 replies

Mar 15, 2009 9:32 PM in response to GabrielZ

The issue that I think you're running into is the fact that an application like this breaks some of the rules that Apple has set-up for applications. Because of this I would strongly suspect that the only way to circumvent these restrictions is to write a kernel extension that alters the way the system operates. If you download the package Ray referenced I bet it installs a .kext onto your system that provides the functionality.

The bad news about this is that kernel programming is not for the non-guru level programmer. Kernel extensions run without memory protection, or any of the other modern niceties, in the very operating system of the computer and software bugs can actually crash the entire computer and lead to data corruption and loss.

It is possible they have managed to find a way to do this without a kernel extension and if they have maybe you can too, but I think it is the most obvious solution.

HTH,

=Tod

Mar 15, 2009 10:23 PM in response to Tod Kuykendall

Tod Kuykendall wrote:
The issue that I think you're running into is the fact that an application like this breaks some of the rules that Apple has set-up for applications. Because of this I would strongly suspect that the only way to circumvent these restrictions is to write a kernel extension that alters the way the system operates. If you download the package Ray referenced I bet it installs a .kext onto your system that provides the functionality.


I can name several dozen applications that float their windows without installing any kernel extensions.

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/ NSWindowClass/Reference/Reference.html#//apple_ref/doc/cref/NSNormalWindowLevel

Mar 16, 2009 3:51 AM in response to Tod Kuykendall

I would strongly suspect that the only way to circumvent these restrictions is to write a kernel extension


Here is one application that does not install a kernel extension: it's called "Highlight" ( http://krugazor.free.fr/software/highlight/ - right now, the server seems to be down ;-( ); once invoked, you can draw an the screen over any window / app, no matter which app is currently active. And it shows a little button to activate the drawing mode. The button always stays on top of all other windows, even when powerpoint is in presentation mode. Very handy little app, btw.

Best regards,
Gabriel.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to create a special Cocoa window ...

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.