- (void)drawRect:(NSRect)dirtyRect
{
// 여기에 그리는 코드가 들어간다.
}
// 사각형 그리기
[[NSColor blackColor] set];
NSRectFill(dirtyRect);
// 텍스트 그리기
NSString * str1 = [[NSString alloc] initWithFormat:@"Hello world %d, 100];
// 텍스트 그리기
NSString * str1 = [[NSString alloc] initWithFormat:@"Hello world %d, 100];
NSMutableDictionary * str_attributes = [[NSMutableDictionary alloc] init];
[str_attributes setObject:[NSColor blueColor] forKey:NSForegroundColorAttributeName];
[str_attributes setObject:[NSColor blueColor] forKey:NSForegroundColorAttributeName];
[str drawAtPoint:NSMakePoint(100,100) withAttributes:str_attributes];
[str release];
댓글 없음:
댓글 쓰기