Subclassing NSPopUpButton and NSPopUpButtonCell
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