• 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
altering width of NSComboBox's popup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: UIDatePicker in landscape - displaying items moving into position weirdness
  • Next by Date: Re: UIDatePicker in landscape - displaying items moving into position weirdness
  • Previous by thread: Re: UIDatePicker in landscape - displaying items moving into position weirdness
  • Next by thread: Finding a printer on bonjour
  • Index(es):
    • Date
    • Thread