Copyright ã1994 by NeXT Computer, Inc.  All Rights Reserved.

NSFontPanel 

Inherits From:	NSPanel : NSWindow : NSResponder : NSObject

Conforms To:	NSCoding (NSResponder)
NSObject (NSObject)

Declared In:	AppKit/NSFontPanel.h 

Class Description

The NSFontPanel class declares the programmatic interface to a user-interface object that displays a list of available fonts, enabling users to preview them and change the typefaces in which text is displayed. Actual changes to text are effected through conversion messages sent to the NSFontManager. There is only one NSFontPanel object for each application.

In general, you add the facilities of the NSFontPanel (and of the other components of the font conversion system: the NSFontManager and the Font menu) to your application through interface construction tools (such as Interface Builder). You do this by including a Font menu into one of your application's menus. At runtime, when the user chooses the Font Panel command for the first time, the NSFontPanel object is created and hooked into the font conversion system. You can also create (or access) NSFontPanel through the sharedFontPanel method. 

An NSFontPanel can be customized by adding an additional NSView object or hierarchy of NSView objects by using the setAccessoryView: method. If you want the NSFontManager to instantiate a panel object from some class other than NSFontPanel, use the NSFontManager's setFontPanelFactory: method. See NSFontManager for details on the font manager object that performs font conversion tasks. 

Creating an NSFontPanel 

+ (NSFontPanel *)sharedFontPanel	Returns an NSFontPanel object.

- (NSFont *)panelConvertFont:(NSFont *)fontObject	

	Returns a Font object whose traits are the same as those of fontObject except as specified by the user's choices in the Font Panel.

Setting the Font 

- (void)setPanelFont:(NSFont *)fontObject	Sets the FontPanel's current font from fontObject with flag
 isMultiple:(BOOL)flag		 indicating whether it contains multiple fonts.

Configuring the NSFontPanel 

- (NSView *)accessoryView	Returns the application-customized view.

- (BOOL)isEnabled	Returns whether the FontPanel's Set button is enabled.

- (void)setAccessoryView:(NSView *)aView	Adds aView above the action buttons at the bottom of the panel.

- (void)setEnabled:(BOOL)flag	Enables or disables the FontPanel's Set button depending on flag.

- (BOOL)worksWhenModal	Returns whether FontPanel works when another window is modal.

Displaying the NSFontPanel 

- (void)orderWindow:(NSWindowOrderingMode)place	 
relativeTo:(int)otherWindows	Repositions the FontPanel above or below the other windows otherWindows as indicated by place and updates the FontPanel if necessary.