• 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
Subclassing NSPopUpButton and NSPopUpButtonCell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Subclassing NSPopUpButton and NSPopUpButtonCell


  • Subject: Subclassing NSPopUpButton and NSPopUpButtonCell
  • From: Stephen Blinkhorn <email@hidden>
  • Date: Tue, 21 Jul 2009 08:36:53 -0600

Hello Cocoa-Dev,

Oh the joy of subclassing subclasses of NSControl and NSCell. I am making a custom pop up menu object. I subclass NSPopUpButtonCell and simply draw my custom menu button in the drawBezelWithFrame method.

The frame rect that this method passes in has been inset by some amount which means that the menu registers mouse clicks for several pixel rows above its drawing frame but rejects mouse clicks for several pixel rows at the bottom of its frame. I have tried using the bounds rect of the control view but I get the same behaviour. How can I get the real bounding rect of the cell? I have the same problem with a subclass of NSTextFieldCell.

I did try creating a pop up menu control from scratch by creating menus and managing the state of its items and I could finish this but it feels like I'm reinventing the wheel really.

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


  • Prev by Date: iPhone Question: UIScrollView
  • Next by Date: Re: iPhone Question: UIScrollView
  • Previous by thread: Re: iPhone Question: UIScrollView
  • Next by thread: what is this currency symbol?
  • Index(es):
    • Date
    • Thread