i'm attempting to programatically change the background color of my NSCollectionView.
first i subcleassed it = CollectionBackground : NSCollectionView, and added the IBAction methods to the header:
then i added the actions to the implementation file:
except for the NSLogs, nothing is happening... is this the proper way to do this?
first i subcleassed it = CollectionBackground : NSCollectionView, and added the IBAction methods to the header:
Code:
#import <Cocoa/Cocoa.h>
@interface CollectionBackground : NSCollectionView
{
}
- (IBAction)backgroundColorBlack:(id)sender;
- (IBAction)backgroundColorGray:(id)sender;
- (IBAction)backgroundColorWhite:(id)sender;
@end
then i added the actions to the implementation file:
Code:
#import "CollectionBackground.h"
@implementation CollectionBackground
- (IBAction)backgroundColorBlack:(id)sender
{
NSLog (@"Background Tunred Black");
[super setBackgroundColors:[NSArray arrayWithObjects:[NSColor blackColor], nil]];
}
- (IBAction)backgroundColorGray:(id)sender
{
NSLog (@"Background Tunred Gray");
[super setBackgroundColors:[NSArray arrayWithObjects:[NSColor grayColor], nil]];
}
- (IBAction)backgroundColorWhite:(id)sender
{
NSLog (@"Background Tunred White");
[super setBackgroundColors:[NSArray arrayWithObjects:[NSColor whiteColor], nil]];
}
@end
except for the NSLogs, nothing is happening... is this the proper way to do this?