root/trunk/NSMenu_Additions.m
| Revision 32, 361 bytes (checked in by bart, 4 years ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | #import "NSMenu_Additions.h" |
| 2 | |
| 3 | @implementation NSMenu (NSMenu_Additions) |
| 4 | - (id <NSMenuItem>) itemWithRepresentation:(id)rep { |
| 5 | NSArray *items = [self itemArray]; |
| 6 | NSEnumerator *e = [items objectEnumerator]; |
| 7 | id <NSMenuItem> anItem; |
| 8 | while (anItem = [e nextObject]) { |
| 9 | if ([[anItem representedObject] isEqual:rep]) { |
| 10 | return anItem; |
| 11 | } |
| 12 | } |
| 13 | return nil; |
| 14 | } |
| 15 | @end |
Note: See TracBrowser for help on using the browser.
