• 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
Font Manager changeFont Method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Font Manager changeFont Method


  • Subject: Font Manager changeFont Method
  • From: hac <email@hidden>
  • Date: Sun, 20 May 2007 17:50:47 -0400

I'm trying to show the font panel, and display the selected font in a
text field, with two seperate text fields and actions to set the font.
I set up the delegate for sharedFontManager, but changeFont is never
called.

This is my code:

static BOOL changingFontA = NO;

- (IBAction)setFontA:(id)sender
{
   changingFontA = YES;
   [[NSFontManager sharedFontManager] setSelectedFont:fontA isMultiple:NO];
   [[NSFontManager sharedFontManager] orderFrontFontPanel:self];
}

- (IBAction)setFontB:(id)sender
{
   changingFontA = NO;
   [[NSFontManager sharedFontManager] setSelectedFont:fontB isMultiple:NO];
   [[NSFontManager sharedFontManager] orderFrontFontPanel:self];
}

- (void)changeFont:(id)sender
{
   if (changingFontA) {
		fontA = [sender convertFont:fontA];
       showFontInField(fontA, fontBoxA);
		return;
   } else {
       fontB = [sender convertFont:fontB];
       showFontInField(fontB, fontBoxB);
		return;
   }
}

Am I missing something? Thanks.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: Font Manager changeFont Method
      • From: hac <email@hidden>
  • Prev by Date: Observing related attributes via a to-many relationship
  • Next by Date: Re: Font Manager changeFont Method
  • Previous by thread: Re: Observing related attributes via a to-many relationship
  • Next by thread: Re: Font Manager changeFont Method
  • Index(es):
    • Date
    • Thread