font panel delegate
font panel delegate
- Subject: font panel delegate
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Sun, 13 Oct 2002 14:57:36 +0200
In some class (subclass of NSObject) I have these two methods:
- (void)start
{
id sharedFontManager = [ NSFontManager sharedFontManager ];
id sharedFontPanel = [ NSFontPanel sharedFontPanel ];
// Before the NSFontPanel adds a particular font family or face to its
list,
// the NSFontPanel asks its delegate to confirm the addition by
sending
// the delegate a fontManagerWillIncludeFont message.
// this is the delegate of the font panel, right?
// NSFontPanel does not have delegate methods, but NSFontManager has
// the documentation is not very clear, what to do, so I do both:
[ sharedFontManager setDelegate: self ] ;
[ sharedFontPanel setDelegate: self ] ;
// Triggers a reload to the default state, so that the delegate will
be called.
// This provides the delegate opportunity to scrutinize the default
list of
// fonts to be displayed in the panel
[ sharedFontPanel reloadDefaultFontFamilies ];
[ sharedFontPanel orderFront: self ];
}
- (BOOL)fontManager:(id)theFontManager willIncludeFont:(NSString
*)fontName
{
NSLog(@"fontManagerWillIncludeFont" );
return YES ;
}
The problem is that fontManagerWillIncludeFont is never called.
What am I doing wrong?
Gerriet.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.