Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Windows that don't get events

Windows that don't get events
Thread Tools
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Jun 24, 2005, 08:00 PM
 
Do you know the windows that pop up when you change the volume or monitor brightness with the F1-F4 keys? They don't intercept events - they simply pass through to the window behind them. I'd like to make such windows - does anyone know how? The NSNonactivatingPanelMask for NSPanel sounded promising...

Thanks!
     
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
Jun 24, 2005, 11:57 PM
 
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.
(Last edited by Wevah; Jun 25, 2005 at 12:05 AM. )
[Wevah setPostCount:[Wevah postCount] + 1];
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Jun 25, 2005, 11:35 AM
 
Wow, I can't believe I overlooked that method. Thanks!
     
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
Jun 25, 2005, 12:00 PM
 
No prob.
[Wevah setPostCount:[Wevah postCount] + 1];
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:18 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2