altering width of NSComboBox's popup
altering width of NSComboBox's popup
- Subject: altering width of NSComboBox's popup
- From: Eric Slosser <email@hidden>
- Date: Fri, 11 Dec 2009 15:35:20 -0500
I'd like to display a NSComboBox that is narrower than the widest of strings in the list of items, but have the popup list be wide enough so the whole string can be read. But I haven't found a way to have the 'non-tracking' width to be different from the tracking width.
I've tried altering the width in a delegate's comboBoxWillPopUp:, calling [obj setFrame:], but that affects the width of the unclicked area, the scrolling list is still narrow.
I've tried subclassing NSComboBox, and doing the same width switching by overriding and wrapping -[NSComboBox mouseDown:], but that seems to cancel the display of the popup altogether.
I imagine I could try getting the NSComboBox's menu, and calling -[NSMenu setMinimumWidth:] on it, but that call isn't available until 10.6, and I'm supporting 10.4.11.
I don't see how I'd play with NSComboBoxCell, but maybe that's part of the solution.
FWIW, I'm using "setButtonBordered:NO".
Would someone please cast me a pearl?
_______________________________________________
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