• 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
NSMenuItem : acceptsFirstMouse(forEvent: NSEvent)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSMenuItem : acceptsFirstMouse(forEvent: NSEvent)


  • Subject: NSMenuItem : acceptsFirstMouse(forEvent: NSEvent)
  • From: Mark Wade via Cocoa-dev <email@hidden>
  • Date: Tue, 24 Sep 2019 13:23:09 -0400

Hi All,

I’m at a loss here.  I’ve created a statusbar item, using Swift 5, whose first
menu item is a textwithstepper NSDatePicker which I created by setting the menu
item’s view. This all works fine when run from within XCode.  Running the app
directly still works, however I can’t select the fields to change with the
stepper, why it works in Xcode and not without I don’t know. So, I’m thinking I
have to implement acceptsFirstMouse(for event:) to return true, I think.

I’ve subclassed NSMenuItem and overridden acceptsFirstMouse( for event:) but
then how do I add the NSDatePicker? I can’t override the NSMenuItem view
variable, if I set the view to my subclass and then set the view to the
datepicker, it’s not my subclass anymore. I’ve been over and over this and I’m
just not getting it.

A clue, a pointer, an example, anything would be appreciated.

— Mark

_______________________________________________

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: NSMenuItem : acceptsFirstMouse(forEvent: NSEvent)
      • From: Mark Wade via Cocoa-dev <email@hidden>
  • Prev by Date: kCAFilterTrilinear
  • Next by Date: CGImageSourceCopyPropertiesAtIndex fails sometimes
  • Previous by thread: kCAFilterTrilinear
  • Next by thread: Re: NSMenuItem : acceptsFirstMouse(forEvent: NSEvent)
  • Index(es):
    • Date
    • Thread