Re: Font Manager changeFont Method
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