public
Description: Gem Document Viewer for Mac OS X
Homepage: http://www.robinlu.com/blog/goo/
Clone URL: git://github.com/robin/goo.git
goo / GemTableView.m
100644 33 lines (23 sloc) 0.803 kb
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
29
30
31
32
33
//
// GemTableView.m
// goo
//
// Created by Robin Lu on 8/22/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
 
#import "GemTableView.h"
 
 
@implementation GemTableView
- (void)rightMouseDown:(NSEvent *)theEvent {
NSPoint p = [self convertPoint:[theEvent locationInWindow] fromView:nil];
 
int i = [self rowAtPoint:p];
 
if (i < [self numberOfRows] && ![[self selectedRowIndexes] containsIndex:i]) {
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:i] byExtendingSelection:NO];
}
 
NSDictionary *selected = [[controller arrangedObjects] objectAtIndex:i];
 
NSMenu *cMenu = [self menu];
NSMenuItem *item = [cMenu itemWithTag:3];
BOOL enabled = [[selected objectForKey:@"homepage"] length] > 7;
[item setEnabled:enabled];
 
[super rightMouseDown:theEvent];
}
 
@end