• 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
Re: Making combo box popup wide enough
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making combo box popup wide enough


  • Subject: Re: Making combo box popup wide enough
  • From: Glen Simmons <email@hidden>
  • Date: Thu, 6 Oct 2005 16:45:30 -0500


On Oct 6, 2005, at 4:21 PM, Shaun Wexler wrote:

On Oct 6, 2005, at 1:25 PM, Glen Simmons wrote:


NSComboBox, Cocoa's red-headed stepchild, doesn't do a very good job of displaying its list of choices. Unlike NSPopupButton, which shows the full width of its items, NSComboBox truncates them. How can I get it to do the right thing and show all of its choices? And making the control wider is not an option since the choices may change / be localized.


To pop-up, NSComboBoxCell creates a borderless NSWindow containing a NSTableView with one NSTableColumn. You can access these private objects using a category:


@interface NSComboBoxCell (PrivateAccessorHack)
- (NSTableView *)tableView;
@end

@implementation NSComboBoxCell (PrivateAccessorHack)

- (NSTableView *)tableView
{
    return _tableView;
}

@end

I assume you can figure it out from there...

Thanks for the suggestion, but I generally dislike using private accessors. Anyone have a publicly accessible alternative?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >Making combo box popup wide enough (From: Glen Simmons <email@hidden>)
 >Re: Making combo box popup wide enough (From: Shaun Wexler <email@hidden>)

  • Prev by Date: Re: Making combo box popup wide enough
  • Next by Date: NSTextField bound to NSAtrributedString
  • Previous by thread: Re: Making combo box popup wide enough
  • Next by thread: scrollPoint: causing view to creep
  • Index(es):
    • Date
    • Thread