• 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: Problem with mouse events in a custom NSControl subclass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with mouse events in a custom NSControl subclass


  • Subject: Re: Problem with mouse events in a custom NSControl subclass
  • From: Stephen Blinkhorn <email@hidden>
  • Date: Mon, 14 Dec 2009 09:07:31 -0600

On 11 Dec 2009, at 17:57, Stephen Blinkhorn wrote:

I'm writing the Cocoa GUI for an audio unit plugin and I've run into a problem. In one host app I'm not receiving mouse events in my custom sliders/buttons etc. My drop down menus work fine but they are subclasses of NSPopUpMenu and NSPopUpMenuCell. The sliders are just NSControl subclasses. If I click on a text field then the containing window gets the focus and all my controls work as expected. I think the host should be setting the containing window's focus but it isn't and other plugins work ok in that host.

instead of doing this:

-(BOOL)acceptsFirstMouse {
	return YES;
}

try doing this:

-(BOOL)acceptsFirstMouse:(NSEvent*)event {
	[[event window] makeKeyAndOrderFront:nil];
	return YES;
}

Thanks,
Stephen

_______________________________________________

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


References: 
 >Problem with mouse events in a custom NSControl subclass (From: Stephen Blinkhorn <email@hidden>)

  • Prev by Date: Re: App Launches in Finder, Hangs While Launching in Debugger
  • Next by Date: Re: App Launches in Finder, Hangs While Launching in Debugger
  • Previous by thread: Problem with mouse events in a custom NSControl subclass
  • Next by thread: Bluetooth failure
  • Index(es):
    • Date
    • Thread