Carbon


TXNDoFontMenuSelection

Header: MacTextEditor.h Carbon status: Supported

Changes the font of the current selection.

OSStatus TXNDoFontMenuSelection (
    TXNObject iTXNObject, 
    TXNFontMenuObject iTXNFontMenuObject, 
    SInt16 menuID, 
    SInt16 menuItem
);
Parameter descriptions
iTXNObject

A variable of type TXNObject. Pass the text object that contains the current selection.

iTXNFontMenuObject

A variable of type TXNFontMenuObject. Pass the Font menu object that identifies the current Font menu. You obtain a TXNFontMenuObject from TXNNewFontMenuObject.

menuID

A signed 16-bit integer value that identifies the selected menu. You should supply the high 16 bits of the long word obtained from the Menu Manager function MenuSelect. You must pass the menu ID because the Font menu may have hierarchical submenus.

menuItem

A signed 16-bit integer value that identifies the selected menu item. You should supply the low 16 bits of the long word obtained from the Menu Manager function MenuSelect.

function result

A result code.

DISCUSSION

When you receive a mouse-down event in one of your application’s menus, you typically call the Menu Manager function MenuSelect to determine which menu and menu item the user has chosen. After calling the MenuSelect function, you should check whether the mouse-down event occurred in one of your application’s menus. If it did not, you should pass the IDs of the menu and menu item to the TXNDoFontMenuSelection function. If the value you supply in the iMenuID parameter identifies the Font menu or one of its submenus, TXNDoFontMenuSelection changes the font of the currently selected text to the font that the user selects.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)