-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCPMenu.j
More file actions
28 lines (22 loc) · 814 Bytes
/
CPMenu.j
File metadata and controls
28 lines (22 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// (c) 2010-2011 by Anton Korenyushkin
@implementation CPMenu (Utils)
- (void)removeAllItems // public
{
for (var index = [self numberOfItems] - 1; index >= 0; --index)
[self removeItemAtIndex:index];
}
- (CPMenuItem)addItemWithTitle:(CPString)title // public
{
return [self addItemWithTitle:title action:nil keyEquivalent:nil];
}
- (CPMenuItem)addItemWithTitle:(CPString)title target:(id)target action:(SEL)action keyEquivalent:(CPString)keyEquivalent // public
{
var item = [self addItemWithTitle:title action:action keyEquivalent:keyEquivalent];
[item setTarget:target];
return item;
}
- (CPMenuItem)addItemWithTitle:(CPString)title target:(id)target action:(SEL)action // public
{
return [self addItemWithTitle:title target:target action:action keyEquivalent:nil];
}
@end