I'm trying to use an NSFontPanel to allow the user to change an application-wide font setting. It's supposed to work something like this: the user clicks a button, a font panel pops up, they choose a font and a size, and their selection is persisted.
The following code shows the panel:
- (IBAction)showFontMenu:(id)sender {
NSFontManager *fontManager = [NSFontManager sharedFontManager];
[fontManager setDelegate:self];
NSFontPanel *fontPanel = [fontManager fontPanel:YES];
[fontPanel makeKeyAndOrderFront:sender];
}
The documentation seems to suggest that the changeFont:(id)sender method should be called when the font changes; this isn't happening in my case.
- (void)changeFont:(id)sender {
// blah
}
Any ideas on what I might be doing wrong?