forked from coo-ona/cooViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCOTextView.m
52 lines (47 loc) · 808 Bytes
/
COTextView.m
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// COTextView.m
// cooViewer
//
// Created by coo on 08/02/17.
// Copyright 2008 coo. All rights reserved.
//
#import "COTextView.h"
@implementation COTextView
- (void)setTarget:(id)tar
{
target = tar;
[self setSelectedTextAttributes:[NSDictionary dictionary]];
}
- (void)setAction:(SEL)sel
{
selector = sel;
}
- (void)keyDown:(NSEvent *)theEvent
{
[target performSelector:selector withObject:theEvent];
}
- (BOOL)shouldDrawInsertionPoint
{
return NO;
}
- (BOOL)becomeFirstResponder
{
[self setBackgroundColor:[NSColor lightGrayColor]];
return YES;
}
- (BOOL)resignFirstResponder
{
[self setBackgroundColor:[NSColor whiteColor]];
return YES;
}
- (void)mouseMoved:(NSEvent *)theEvent
{
[[NSCursor arrowCursor] set];
}
/*
- (void)resetCursorRects
{
[self discardCursorRects];
}
*/
@end