This is NSMenu.rtf in view mode; [Download] [Up]
paperh18648 margl-907 margr0 margt0 margb0 fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1994 by NeXT Computer, Inc. All Rights Reserved. s4 li100 fi0 ri1007 ql f0 b fs36 fs100 fs36 NSMenu pard s11 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSPanel : NSWindow : NSResponder : NSObject fs20 fs28 s6 f0 b fs24 Conforms To:tab b0 fs28 f1 NSCoding (NSResponder) fi0 NSObject (NSObject) fs20 fs28 s7 fi-2771 f0 b fs24 Declared In:tab b0 fs28 f1 AppKit/NSMenu.h fs20 fs28 pard s16 li100 fi0 ri1007 ql f0 b fs28 fs20 fs28 Class Description fs14 fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 fs28 This class defines an object that manages an application'27s menus. An NSMenu object displays a list of items that a user can choose from. When an item is clicked, it may either issue a command directly or bring up another menu (a i submenui0 ) that offers further choices. An NSMenu object'27s choices are implemented as a column of NSMenuCells in an NSMatrix. fs16 fs28 Each NSMenuCell can be configured to send its action message to a target, or to bring up a submenu. When the user clicks a submenu item, the submenu is displayed on the screen, attached to its supermenu so that if the user drags the supermenu, the submenu follows it. A submenu may also be torn away from its supermenu, in which case it displays a close button. fs16 fs28 Exactly one NSMenu created by the application is designated as the main menu for the application (with NSApplication'27s b setMainMenu:b0 method). This menu is displayed on top of all other windows whenever the application is active, and should never display a close button (because the main menu doesn'27t have a supermenu). fs16 fs28 See the NSMenuCell and NSMatrix class specificiations for more details. fs16 fs28 pard s16 li100 fi0 ri1007 ql f0 b fs24 fs28 Controlling Allocation Zones fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 + (NSZone *)b menuZoneb0 tab Returns the zone from which NSMenus should be allocated, creating one if necessary. fi-6552 fs16 fs28 fi-6552 + (void)b setMenuZone:b0 (NSZone *)i zonei0 tab Sets the zone from which NSMenus should be allocated. pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Initializing a New NSMenu fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (id)b initWithTitle:b0 (NSString *)i aTitlei0 tab Initializes and returns a new NSMenu using i aTitlei0 for its title. pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Setting Up the Menu Commands fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (id)b addItemWithTitle:b0 (NSString *)i aStringi0 tab Adds a new item with title i aStringi0 , action i aSelectori0 , and s9 li7030 fi-6553 fi-5796 b action:b0 (SEL)i aSelectori0 tab tab key equivalent i charCodei0 to the end of the NSMenu. b keyEquivalent:b0 (NSString *)i charCodei0 tab tab Returns the new NSMenuCell. s8 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 {f3 -} (id)b insertItemWithTitle:b0 (NSString *)i aStringi0 tab Adds a new item at i indexi0 having the title i aStringi0 , action s9 li7030 fi-6553 fi-5796 b action:b0 (SEL)i aSelectori0 tab i tab aSelectori0 , and key equivalent i charCodei0 . Returns the b keyEquivalent:b0 (NSString *)i charCodei0 tab tab new NSMenuCell. b atIndex:b0 (unsigned int)i index s8 li7029 fi-5794 fi-6552 i0 fs16 fs28 fi-6552 {f3 -} (NSMatrix *)b itemMatrixb0 tab Returns the NSMatrix of NSMenuCell items. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setItemMatrix:b0 (NSMatrix *)i aMatrixi0 tab Replaces the current matrix of items with i aMatrixi0 . pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Finding Menu Items fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (id)b cellWithTag:b0 (int)i aTagi0 tab Returns the NSMenuCell that has i aTagi0 as its tag. pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Building Submenus fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (NSMenuCell *)b setSubmenu:b0 (NSMenu *)i aMenui0 tab Makes i aMenui0 a submenu controlled by i aCelli0 . s9 li7030 fi-6553 fi-5796 b forItem:b0 (NSMenuCell *)i aCell s8 li7029 fi-5794 fi-6552 i0 fs16 fs28 fi-6552 {f3 -} (void)b submenuAction:b0 (id)i senderi0 tab Activates a submenu attached to sender'27s NSMenu. pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Managing NSMenu Windows fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (NSMenu *)b attachedMenub0 tab Returns the NSMenu attached to the receiver or b nilb0 if there'27s no such object. fi-6552 fs16 fs28 fi-6552 {f3 -} (BOOL)b isAttachedb0 tab Returns YES if the receiver is attached to another menu and NO otherwise. fi-6552 fs16 fs28 fi-6552 {f3 -} (BOOL)b isTornOffb0 tab Returns NO if the receiver is attached to another menu (or if it'27s the main menu) and YES otherwise. fi-6552 fs16 fs28 fi-6552 {f3 -} (NSPoint)b locationForSubmenu:b0 (NSMenu *)i aSubmenu s9 li7030 fi-6553 fi-5796 i0 tab Determines where to display an attached submenu when it'27s brought up. s8 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b sizeToFitb0 tab Resizes the receiver to exactly fit the command items. fi-6552 fs16 fs28 fi-6552 {f3 -} (NSMenu *)b supermenub0 tab Returns the receiver'27s supermenu. pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Displaying the Menu fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (BOOL)b autoenablesItemsb0 tab Returns whether the receiver enables and disables its NSMenuCells. (See the NSMenuActionResponder informal protocol.) fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setAutoenablesItems:b0 (BOOL)i flagi0 tab Sets whether the receiver enables and disables its NSMenuCells. (See the NSMenuActionResponder informal protocol.) }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.