Re: Perform additional action when window receives any mouse- or keyDown
Uh, if I understand what the op wants to do correctly, overriding - [NSWindow mouseDown:] isn't going to do it. If the user clicks inside a view that overrides -mouseDown: (and friends -rightMouseDown: and -otherMouseDown:), there's no guarantee that your window's override will get called. Overriding sendEvent seems like the best plan. _murat On Feb 16, 2010, at 1:05 PM, Jerry Krinock wrote: On 2010 Feb 16, at 10:58, Paul Sanders wrote: -[NSWindow mouseDown:]? (inherited from NSResponder). Thanks, Paul. I hadn't realized that inheritance. Also, I'd need -rightMouseDown:, -keyDown:, -otherMouseDown:, ??? At least, no notification needed. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Perform additional action when window receives any mouse- or keyDown
Yes, I think I go along with that. It lets you handle all the events you choose to handle in one place. Paul Sanders. - Original Message - From: "Kyle Sluder" To: "Jerry Krinock" Cc: "Cocoa Developers" Sent: Tuesday, February 16, 2010 9:56 PM Subject: Re: Perform additional action when window receives any mouse- or keyDown On Tue, Feb 16, 2010 at 9:48 AM, Jerry Krinock wrote: > So I subclassed the window, overrode -sendEvent:, invoke super > and post a notification for which my window controller > registers, and in the notification handler I examine the event > type. It works, but this seems quite heavy-handed to get > something so simple. Did I miss a more lightweight way to do > this? Actually that seems like precisely the right thing to do. In fact, I would go so far as to post the notification in all circumstances unless it is specifically the kind of event your attached window should process. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/p.sanders%40alpinesoft.co.uk This email sent to p.sand...@alpinesoft.co.uk ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Perform additional action when window receives any mouse- or keyDown
On Tue, Feb 16, 2010 at 9:48 AM, Jerry Krinock wrote: > So I subclassed the window, overrode -sendEvent:, invoke super and post a > notification for which my window controller registers, and in the > notification handler I examine the event type. It works, but this seems > quite heavy-handed to get something so simple. Did I miss a more lightweight > way to do this? Actually that seems like precisely the right thing to do. In fact, I would go so far as to post the notification in all circumstances unless it is specifically the kind of event your attached window should process. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Perform additional action when window receives any mouse- or keyDown
On 2010 Feb 16, at 10:58, Paul Sanders wrote: > -[NSWindow mouseDown:]? (inherited from NSResponder). Thanks, Paul. I hadn't realized that inheritance. Also, I'd need -rightMouseDown:, -keyDown:, -otherMouseDown:, ??? At least, no notification needed. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Perform additional action when window receives any mouse- or keyDown
-[NSWindow mouseDown:]? (inherited from NSResponder). Paul Sanders. - Original Message - From: "Jerry Krinock" To: "Cocoa Developers" Sent: Tuesday, February 16, 2010 5:48 PM Subject: Perform additional action when window receives any mouse- or keyDown At times, I attach an attached window to a document window. I would like this window to go away whenever the user clicks anything in the window, kind of like a tooltip. So I subclassed the window, overrode -sendEvent:, invoke super and post a notification for which my window controller registers, and in the notification handler I examine the event type. It works, but this seems quite heavy-handed to get something so simple. Did I miss a more lightweight way to do this? Thanks, Jerry Krinock ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com