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