I am reading Apple's sample codes at:
http://developer.apple.com/library/mac/#samplecode/CocoaSlides/Introduction/Intro.html
it works on a NSView
#import <Cocoa/Cocoa.h>
@class Asset;
@class AssetCollection;
// An AssetCollectionView displays the contents of an AssetCollection
@interface AssetCollectionView :NSView
{
// Model
AssetCollection *assetCollection;
// Controller Glue
NSMutableArray *nodes;
// Appearance Attributes
NSGradient *backgroundGradient;
// UI State
BOOL autoCyclesLayout;
NSTimeInterval layoutCycleInterval;
NSTimer *layoutTimer;
int subviewsLayoutType;
NSArray *sortDescriptors;
BOOL slidesHaveShadows;
BOOL usesQuartzCompositionBackground;
}
- (AssetCollection *)assetCollection;
- (void)setAssetCollection:(AssetCollection *)newAssetCollection;
- (BOOL)autoCyclesLayout;
- (void)setAutoCyclesLayout:(BOOL)flag;
- (NSTimeInterval)layoutCycleInterval;
- (void)setLayoutCycleInterval:(NSTimeInterval)newLayoutCycleInterval;
- (int)subviewsLayoutType;
- (void)setSubviewsLayoutType:(int)layoutType;
- (NSArray *)sortDescriptors;
- (void)setSortDescriptors:(NSArray *)newSortDescriptors;
- (BOOL)slidesHaveShadows;
- (void)setSlidesHaveShadows:(BOOL)flag;
- (BOOL)usesQuartzCompositionBackground;
- (void)setUsesQuartzCompositionBackground:(BOOL)flag;
- (void)reloadData;
@end
but I prefer to change NSView to NSScrollView that I can see the thumbnail outside the window.
But if I change the codes from
@interface AssetCollectionView :NSView
to
@interface AssetCollectionView :NSScrollView
AssetCollectionView will display nothing.
Welcome any comment