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

Re: Font Manager changeFont Method


  • Subject: Re: Font Manager changeFont Method
  • From: hac <email@hidden>
  • Date: Sun, 20 May 2007 18:13:49 -0400

I'm extremely sorry I did't see this before, but there was a thread
almost identical to mine three years go on this list. It cleared
everything up :D.

On 5/20/07, hac <email@hidden> wrote:
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


References: 
 >Font Manager changeFont Method (From: hac <email@hidden>)

  • Prev by Date: Font Manager changeFont Method
  • Next by Date: NSKeyedArchiver - Writing to Existing File
  • Previous by thread: Font Manager changeFont Method
  • Next by thread: NSKeyedArchiver - Writing to Existing File
  • Index(es):
    • Date
    • Thread