diff --git a/MLCalendarSample/MLCalendarView.m b/MLCalendarSample/MLCalendarView.m index 7892e6a..d4b1749 100644 --- a/MLCalendarSample/MLCalendarView.m +++ b/MLCalendarSample/MLCalendarView.m @@ -8,6 +8,7 @@ #import "MLCalendarView.h" #import "MLCalendarCell.h" +#import "MLCalendarBackground.h" @interface MLCalendarView () @@ -45,6 +46,12 @@ + (BOOL) isSameDate:(NSDate*)d1 date:(NSDate*)d2 { } } +//- (void) setBackgroundColor:(NSColor *)backgroundColor { +// _backgroundColor = backgroundColor; +// MLCalendarBackground* bv = (MLCalendarBackground*)self.view; +// bv.backgroundColor = backgroundColor; +//} + - (instancetype) init { self = [super initWithNibName:@"MLCalendarView" bundle:[NSBundle bundleForClass:[self class]]]; if (self != nil) { @@ -75,6 +82,12 @@ - (void) commonInit { _date = [NSDate date]; } +//- (void) setBackgroundColor:(NSColor *)backgroundColor { +// _backgroundColor = backgroundColor; +// MLCalendarBackground* bv = (MLCalendarBackground*)self.view; +// bv.backgroundColor = backgroundColor; +//} + - (void)viewDidLoad { [super viewDidLoad]; self.dayLabels = [NSMutableArray array]; @@ -103,6 +116,8 @@ - (void)viewDidLoad { tf.stringValue = day; } // self.date = [NSDate date]; + MLCalendarBackground* bv = (MLCalendarBackground*)self.view; + bv.backgroundColor = self.backgroundColor; [self layoutCalendar]; }