• 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: NSFontPanel selected font?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSFontPanel selected font?


  • Subject: Re: NSFontPanel selected font?
  • From: Scott Anguish <email@hidden>
  • Date: Tue, 3 Jul 2007 02:49:58 -0400


On Jul 2, 2007, at 2:51 PM, R.L. Grigg wrote:

I wrote a simple Cocoa app that has a Font menu item that brings up the font panel. The user can select a font and dismiss the panel, but how can I catch whatever callback or notification gets issued? There seems to be no [fontPanel selectedFont] method, my - changeFont: method never gets called, and NSFontManager returns nil for selectedFont.

is your changeFont: implementation object part of the responder chain?

This is dated, but might be useful if you're doing it outside of a text view

http://www.stepwise.com/Articles/Technical/HTMLEditor/HTMLEditor-5.1.html


> The Apple doc on NSFontPanel doesn't say much. All I'm trying to do is find out what font got selected; I'm not changing or converting any fonts.


Yeah, but that's how it works... I don't think this has changed in recent years

look at that link above.. here is a snippet that shows the changeFont:

- (void)changeFont:sender;
{
  NSFontManager *fontManager=sender;
  NSFont *newFont;

// in this case [self font]returns the currently stored font by my preferences... but the conversion is necessary to get the new font

  // new font is the currently selected font now.
  newFont=[fontManager convertFont:[self font]];



}



_______________________________________________

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


References: 
 >NSFontPanel selected font? (From: "R.L. Grigg" <email@hidden>)

  • Prev by Date: [MODERATOR - NDA] Re: Looking for NSCollectionView sample code
  • Next by Date: Re: Cocoa Framework for accessing images on USB digital camera
  • Previous by thread: Re: NSFontPanel selected font?
  • Next by thread: Setting line height exactly - fails for certain unicode chars
  • Index(es):
    • Date
    • Thread