mirror of
https://github.com/ksherlock/TwoTerm.git
synced 2024-12-22 07:30:40 +00:00
eede1abbca
git-svn-id: svn://qnap.local/TwoTerm/branches/frameless@2341 5590a31f-7b70-45f8-8c82-aa3a8e5f4507
36 lines
536 B
Objective-C
36 lines
536 B
Objective-C
//
|
|
// ColorView.m
|
|
// 2Term
|
|
//
|
|
// Created by Kelvin Sherlock on 12/20/2011.
|
|
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
|
|
//
|
|
|
|
#import "ColorView.h"
|
|
|
|
@implementation ColorView
|
|
|
|
@synthesize color = _color;
|
|
|
|
- (void)drawRect:(NSRect)dirtyRect
|
|
{
|
|
[_color setFill];
|
|
NSRectFill(dirtyRect);
|
|
}
|
|
|
|
-(void)setColor:(NSColor *)color
|
|
{
|
|
if (_color == color) return;
|
|
[_color release];
|
|
_color = [color retain];
|
|
[self setNeedsDisplay: YES];
|
|
}
|
|
|
|
-(void)dealloc
|
|
{
|
|
[_color release];
|
|
[super dealloc];
|
|
}
|
|
|
|
@end
|