X-Git-Url: http://git.ithinksw.org/ITKit.git/blobdiff_plain/78553c25bacdbd190fd14591420cf4f7fa578617..0fc44e732f98ed55cdd0d0914c4031ad9c005edc:/ITTableView.m?ds=sidebyside diff --git a/ITTableView.m b/ITTableView.m old mode 100755 new mode 100644 index 7cba72b..829b039 --- a/ITTableView.m +++ b/ITTableView.m @@ -1,47 +1,50 @@ #import "ITTableView.h" #import "ITTableCornerView.h" - @implementation ITTableView - (id)initWithFrame:(NSRect)frame { - self = [super initWithFrame:frame]; - if (self) { - corner = [[ITTableCornerView alloc] initWithFrame:[[self cornerView] frame]]; - [corner setPullsDown:YES]; - [self setCornerView:corner]; - } - return self; + if ((self = [super initWithFrame:frame])) { + [self setCornerView:[[ITTableCornerView alloc] initWithFrame:[[self cornerView] frame]]]; + } + return self; } -- (id)initWithCoder:(NSCoder*)coder { - self = [super initWithCoder:coder]; - if (self) { - corner = [[ITTableCornerView alloc] initWithFrame:[[self cornerView] frame]]; - [corner setPullsDown:YES]; - [self setCornerView:corner]; - } - return self; +- (id)initWithCoder:(NSCoder *)coder { + if ((self = [super initWithCoder:coder])) { + [self setCornerView:[[ITTableCornerView alloc] initWithFrame:[[self cornerView] frame]]]; + } + return self; } -- (void)encodeWithCoder:(NSCoder*)coder { - [super encodeWithCoder:coder]; +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; } -- (void)setCornerImage:(NSImage*)image { - [corner setImage:image]; +- (void)setCornerImage:(NSImage *)image { + if ([_cornerView isKindOfClass:[ITTableCornerView class]]) { + [(ITTableCornerView *)_cornerView setImage:image]; + } } -- (NSImage*)cornerImage { - return [corner image]; +- (NSImage *)cornerImage { + if ([_cornerView isKindOfClass:[ITTableCornerView class]]) { + return [(ITTableCornerView *)_cornerView image]; + } + return nil; } -- (void)setCornerMenu:(NSMenu*)menu { - [corner setMenu:menu]; +- (void)setCornerMenu:(NSMenu *)menu { + if ([_cornerView isKindOfClass:[ITTableCornerView class]]) { + [(ITTableCornerView *)_cornerView setMenu:menu]; + } } -- (NSMenu*)cornerMenu { - return [corner menu]; +- (NSMenu *)cornerMenu { + if ([_cornerView isKindOfClass:[ITTableCornerView class]]) { + return [(ITTableCornerView *)_cornerView menu]; + } + return nil; } -@end +@end \ No newline at end of file