• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Handling NSApplicationDefined events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling NSApplicationDefined events


  • Subject: Re: Handling NSApplicationDefined events
  • From: "McLaughlin, Michael P." <email@hidden>
  • Date: Thu, 3 Sep 2009 16:39:43 -0400
  • Acceptlanguage: en-US
  • Thread-topic: Handling NSApplicationDefined events

Quincey Morris wrote:

>It's straightforward. Subclass NSApplication and override sendEvent:
>to test for NSApplicationDefined.
>
>Don't forget to specify your subclass as the "Principal Class" in your
>target's properties.

The one example I found like that passed the event on even though it had
been handled.

Is

@interface MyApplication : NSApplication
{
}

@implementation MyApplication
-(void)sendEvent:(NSEvent *)evt
{
    if ([evt type] == NSApplicationDefined)
        <doSomething>
    else
        [super sendEvent:evt];
}
@end

better?

--
Mike McLaughlin

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Handling NSApplicationDefined events
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: NSControlTextDidChangeNotification - What key pressed?
  • Next by Date: Re: watch changes to any properties on an object
  • Previous by thread: Re: Handling NSApplicationDefined events
  • Next by thread: Re: Handling NSApplicationDefined events
  • Index(es):
    • Date
    • Thread