• 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: Font menu in an NSPopUpButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Font menu in an NSPopUpButton


  • Subject: Re: Font menu in an NSPopUpButton
  • From: Dustin Voss <email@hidden>
  • Date: Thu, 16 Oct 2003 16:54:28 -0700

On Thursday, October 16, 2003, at 02:41 PM, Darrin Cardani wrote:

I want an NSPopUpButton that contains a list of fonts. I see that Interface Builder supplies a menu for fonts that you can put into your menubar menus, but I don't see a way to create a popup button with fonts in it. What's the recommended way to do that?

Programmatically. Here's how I do it in one of my apps:

// Populate font pop-up.
fontList = [[NSMutableArray alloc] initWithArray:[[NSFontManager sharedFontManager] availableFontFamilies]];
[fontList sortUsingSelector:@selector(caseInsensitiveCompare:)];
[fontListPopup removeAllItems];
[fontListPopup addItemsWithTitles: fontList];
[fontList release];

It's simple enough.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Font menu in an NSPopUpButton
      • From: Darrin Cardani <email@hidden>
References: 
 >Font menu in an NSPopUpButton (From: Darrin Cardani <email@hidden>)

  • Prev by Date: Re: Safari and Google-like toolbars
  • Next by Date: Re: Safari and Google-like toolbars
  • Previous by thread: Re: Font menu in an NSPopUpButton
  • Next by thread: Re: Font menu in an NSPopUpButton
  • Index(es):
    • Date
    • Thread