Correct some names. NJOutputController should be NJOutputViewController as it doesn...
[enjoyable.git] / Categories / NSMenu+RepresentedObjectAccessors.h
1 //
2 // NSMenu+RepresentedObjectAccessors.h
3 // Enjoyable
4 //
5 // Created by Joe Wreschnig on 3/4/13.
6 //
7 //
8
9 #import <Cocoa/Cocoa.h>
10
11 @interface NSMenu (RepresentedObjectAccessors)
12 // Helpers for using represented objects in menu items.
13
14 - (NSMenuItem *)itemWithRepresentedObject:(id)object;
15 - (NSMenuItem *)itemWithIdenticalRepresentedObject:(id)object;
16 // Returns the first menu item in the receiver that has a given
17 // represented object.
18
19 - (NSMenuItem *)lastItem;
20 // Return the last menu item in the receiver, or nil if the menu
21 // has no items.
22
23 - (void)removeLastItem;
24 // Removes the last menu item in the receiver, if there is one.
25 //
26 // After and if it removes the menu item, this method posts an
27 // NSMenuDidRemoveItemNotification.
28
29 @end
30
31 @interface NSPopUpButton (RepresentedObjectAccessors)
32
33 - (NSMenuItem *)itemWithRepresentedObject:(id)object;
34 - (NSMenuItem *)itemWithIdenticalRepresentedObject:(id)object;
35 // Returns the first item in the receiver's menu that has a given
36 // represented object.
37
38 - (void)selectItemWithRepresentedObject:(id)object;
39 - (void)selectItemWithIdenticalRepresentedObject:(id)object;
40 // Selects the first item in the receiver's menu that has a give
41 // represented object.
42
43 @end