Customizing Cocoas NSFontPanel

763 Views Asked by At

What customization options are there for Cocoas NSFontPanel?

The NSFontPanel accessible in iWork Pages has "Text Underline", "Text Strikethrough" and "Document Color" controls at the top. We don't want these in our NSFontPanel. Is there any way to remove or disable these controls?

2

There are 2 best solutions below

2
On BEST ANSWER

Implement the NSFontPanelValidation protocol in the relevant responder(s).

0
On

Like you said, the responder must implement the NSFontPanelValidation protocol and override the - (NSUInteger)validModesForFontPanel:(NSFontPanel *)fontPanel method. But this method does not invoked when the NSFontPanel showed.