Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added scrollbar (it currently does nothing)

  • Loading branch information...
commit 997bd8d36fe20e63554f90a7b01fcbca2e2cda1d 1 parent c602b02
@mattball authored
View
16 MBCoverFlowScroller.h
@@ -0,0 +1,16 @@
+//
+// MBCoverFlowScroller.h
+// MBCoverFlowView
+//
+// Created by Matt Ball on 3/24/09.
+// Copyright 2009 Daybreak Apps. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface MBCoverFlowScroller : NSScroller {
+
+}
+
+@end
View
344 MBCoverFlowScroller.m
@@ -0,0 +1,344 @@
+//
+// MBCoverFlowScroller.m
+// MBCoverFlowView
+//
+// Created by Matt Ball on 3/24/09.
+// Copyright 2009 Daybreak Apps. All rights reserved.
+//
+
+#import "MBCoverFlowScroller.h"
+
+@interface MBCoverFlowScroller ()
+- (NSBezierPath *)_leftArrowPath;
+- (NSBezierPath *)_rightArrowPath;
+@end
+
+@interface NSScroller (Private)
+- (NSRect)_drawingRectForPart:(NSScrollerPart)aPart;
+@end
+
+const float MBCoverFlowScrollerKnobMinimumWidth = 20.0;
+
+@implementation MBCoverFlowScroller
+
+- (void)drawRect:(NSRect)rect
+{
+ [self drawKnobSlotInRect:[self rectForPart:NSScrollerKnobSlot] highlight:NO] ;
+ [self drawArrow:NSScrollerIncrementArrow highlight:( [self hitPart] == NSScrollerIncrementLine )] ;
+ [self drawArrow:NSScrollerDecrementArrow highlight:( [self hitPart] == NSScrollerDecrementLine )] ;
+ [self drawKnob] ;
+}
+
+- (NSScrollerPart)testPart:(NSPoint)aPoint
+{
+ [super testPart:aPoint];
+
+ aPoint = [self convertPoint:aPoint fromView:nil];
+
+ if ([[self _leftArrowPath] containsPoint:aPoint]) {
+ return NSScrollerDecrementLine;
+ } else if ([[self _rightArrowPath] containsPoint:aPoint]) {
+ return NSScrollerIncrementLine;
+ } else if (NSPointInRect(aPoint, [self rectForPart:NSScrollerKnob])) {
+ return NSScrollerKnob;
+ }
+ return NSScrollerNoPart;
+}
+
+- (NSRect)rectForPart:(NSScrollerPart)aPart
+{
+ if (aPart == NSScrollerDecrementLine) {
+ NSRect rect = [self rectForPart:NSScrollerKnobSlot];
+ rect.origin.x = 0;
+ rect.size.width = 30.0;
+ return rect;
+ } else if (aPart == NSScrollerIncrementLine) {
+ NSRect rect = [self rectForPart:NSScrollerKnobSlot];
+ rect.size.width = 30.0;
+ rect.origin.x = [self frame].size.width - rect.size.width;
+ return rect;
+ } else if (aPart == NSScrollerKnobSlot) {
+ NSRect rect;
+ rect.size.height = 16.0;
+ rect.origin.x = 15.0;
+ rect.size.width = [self frame].size.width - 2*rect.origin.x;
+ rect.origin.y = [self frame].size.height - rect.size.height;
+ return rect;
+ } else if (aPart == NSScrollerKnob) {
+ NSRect rect = [self rectForPart:NSScrollerKnobSlot];
+ float maxWidth = [self frame].size.width - ([self rectForPart:NSScrollerDecrementLine].size.width - 8.0 - 1.0) - ([self rectForPart:NSScrollerIncrementLine].size.width - 8.0 - 1.0);
+ float minWidth = MBCoverFlowScrollerKnobMinimumWidth;
+ rect.size.width = fmax(maxWidth * [self knobProportion], minWidth);
+
+ rect.origin.x = NSMaxX([self rectForPart:NSScrollerDecrementLine]) - 8.0 - 1.0;
+ rect.origin.x += [self floatValue] * (maxWidth - rect.size.width);
+
+ return rect;
+ } else if (aPart == NSScrollerDecrementPage) {
+
+ } else if (aPart == NSScrollerIncrementPage) {
+
+ }
+
+ return NSZeroRect;
+}
+
+/* The documentation for NSScroller says to use -drawArrow:highlight:, but
+ * that's never called. -drawArrow:highlightPart: is.
+ */
+- (void)drawArrow:(NSScrollerArrow)arrow highlightPart:(BOOL)flag
+{
+ [self drawArrow:arrow highlight:flag];
+}
+
+/* Since we've repositioned the arrows, NSScroller doesn't want to redisplay
+ * the left one when it's clicked. Thus, we should just always redisplay the
+ * entire view */
+- (void)setNeedsDisplayInRect:(NSRect)rect
+{
+ if (!NSEqualRects(rect, [self bounds])) {
+ rect = [self bounds];
+ }
+
+ [super setNeedsDisplayInRect:rect];
+}
+
+- (void)drawArrow:(NSScrollerArrow)arrow highlight:(BOOL)flag
+{
+ if (arrow == NSScrollerDecrementArrow) {
+ NSBezierPath *arrowPath = [self _leftArrowPath];
+ [[NSGraphicsContext currentContext] saveGraphicsState];
+ [arrowPath addClip];
+
+ // Draw the background
+ NSColor *outlineColor = [NSColor colorWithCalibratedWhite:1.0 alpha:0.5];
+ NSColor *bgTop = [NSColor colorWithCalibratedWhite:0.1 alpha:1.0];
+ NSColor *bgBottom = [NSColor colorWithCalibratedWhite:0.0 alpha:1.0];
+
+ if (flag) {
+ outlineColor = [NSColor colorWithCalibratedWhite:1.0 alpha:1.0];
+ bgTop = [NSColor colorWithCalibratedWhite:0.8 alpha:1.0];
+ bgBottom = [NSColor colorWithCalibratedWhite:0.4 alpha:1.0];
+ }
+
+ // Draw the background
+ NSGradient *bgGradient = [[NSGradient alloc] initWithStartingColor:bgTop endingColor:bgBottom];
+ [bgGradient drawInBezierPath:arrowPath angle:90.0];
+ [bgGradient release];
+
+ // Draw the gloss
+ NSColor *glossTop = [NSColor colorWithCalibratedWhite:1.0 alpha:0.3];
+ NSColor *glossBottom = [NSColor colorWithCalibratedWhite:1.0 alpha:0.1];
+ NSGradient *glossGradient = [[NSGradient alloc] initWithStartingColor:glossTop endingColor:glossBottom];
+ NSRect glossRect = [self rectForPart:NSScrollerDecrementLine];
+ glossRect.origin.x += 4.0;
+ glossRect.size.width += 20.0;
+ glossRect.size.height /= 2.0;
+ NSBezierPath *glossPath = [NSBezierPath bezierPathWithRoundedRect:glossRect xRadius:8.0 yRadius:4.0];
+ [glossGradient drawInBezierPath:glossPath angle:90.0];
+ [glossGradient release];
+
+ [arrowPath setLineWidth:2.0];
+
+ [outlineColor set];
+ [arrowPath stroke];
+
+ [[NSGraphicsContext currentContext] restoreGraphicsState];
+
+ // Draw the arrow
+ NSRect arrowRect = [self rectForPart:NSScrollerDecrementLine];
+ NSPoint glyphTip = NSMakePoint(arrowRect.origin.x + 9.0, NSMidY(arrowRect));
+ NSPoint glyphTop = NSMakePoint(glyphTip.x + 6.0, NSMinY(arrowRect) + 5.0);
+ NSPoint glyphBottom = NSMakePoint(glyphTop.x, NSMaxY(arrowRect) - 5.0);
+ NSBezierPath *glyphPath = [NSBezierPath bezierPath];
+ [glyphPath moveToPoint:glyphTip];
+ [glyphPath lineToPoint:glyphTop];
+ [glyphPath lineToPoint:glyphBottom];
+ [glyphPath lineToPoint:glyphTip];
+ [glyphPath closePath];
+ [outlineColor set];
+ [glyphPath fill];
+
+ } else if (arrow == NSScrollerIncrementArrow) {
+ NSBezierPath *arrowPath = [self _rightArrowPath];
+ [[NSGraphicsContext currentContext] saveGraphicsState];
+ [arrowPath addClip];
+
+ // Draw the background
+ NSColor *outlineColor = [NSColor colorWithCalibratedWhite:1.0 alpha:0.5];
+ NSColor *bgTop = [NSColor colorWithCalibratedWhite:0.1 alpha:1.0];
+ NSColor *bgBottom = [NSColor colorWithCalibratedWhite:0.0 alpha:1.0];
+ if (flag) {
+ outlineColor = [NSColor colorWithCalibratedWhite:1.0 alpha:1.0];
+ bgTop = [NSColor colorWithCalibratedWhite:0.8 alpha:1.0];
+ bgBottom = [NSColor colorWithCalibratedWhite:0.4 alpha:1.0];
+ }
+
+ // Draw the background
+ NSGradient *bgGradient = [[NSGradient alloc] initWithStartingColor:bgTop endingColor:bgBottom];
+ [bgGradient drawInBezierPath:arrowPath angle:90.0];
+ [bgGradient release];
+
+ // Draw the gloss
+ NSColor *glossTop = [NSColor colorWithCalibratedWhite:1.0 alpha:0.3];
+ NSColor *glossBottom = [NSColor colorWithCalibratedWhite:1.0 alpha:0.1];
+ NSGradient *glossGradient = [[NSGradient alloc] initWithStartingColor:glossTop endingColor:glossBottom];
+ NSRect glossRect = [self rectForPart:NSScrollerIncrementLine];
+ glossRect.origin.x -= 24.0;
+ glossRect.size.width += 20.0;
+ glossRect.size.height /= 2.0;
+ NSBezierPath *glossPath = [NSBezierPath bezierPathWithRoundedRect:glossRect xRadius:8.0 yRadius:4.0];
+ [glossGradient drawInBezierPath:glossPath angle:90.0];
+ [glossGradient release];
+
+ [arrowPath setLineWidth:2.0];
+
+ [outlineColor set];
+ [arrowPath stroke];
+
+ [[NSGraphicsContext currentContext] restoreGraphicsState];
+
+ // Draw the arrow
+ NSRect arrowRect = [self rectForPart:NSScrollerIncrementLine];
+ NSPoint glyphTip = NSMakePoint(NSMaxX(arrowRect) - 9.0, NSMidY(arrowRect));
+ NSPoint glyphTop = NSMakePoint(glyphTip.x - 6.0, NSMinY(arrowRect) + 5.0);
+ NSPoint glyphBottom = NSMakePoint(glyphTop.x, NSMaxY(arrowRect) - 5.0);
+ NSBezierPath *glyphPath = [NSBezierPath bezierPath];
+ [glyphPath moveToPoint:glyphTip];
+ [glyphPath lineToPoint:glyphTop];
+ [glyphPath lineToPoint:glyphBottom];
+ [glyphPath lineToPoint:glyphTip];
+ [glyphPath closePath];
+ [outlineColor set];
+ [glyphPath fill];
+ }
+}
+
+- (void)drawKnobSlotInRect:(NSRect)slotRect highlight:(BOOL)flag
+{
+ NSBezierPath *slotPath = [NSBezierPath bezierPathWithRect:NSInsetRect(slotRect, 0.5, 0.5)];
+ NSColor *bgColor = [NSColor colorWithCalibratedWhite:1.0 alpha:0.3];
+ NSColor *outlineColor = [NSColor colorWithCalibratedWhite:1.0 alpha:0.5];
+
+ [bgColor set];
+ [slotPath fill];
+ [outlineColor set];
+ [slotPath setLineWidth:1.0];
+ [slotPath stroke];
+
+ NSRect insetRect = NSMakeRect(slotRect.origin.x, slotRect.origin.y+1.0, slotRect.size.width, 1.0);
+ [[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set];
+ [NSBezierPath fillRect:insetRect];
+}
+
+- (void)drawKnob
+{
+ NSRect knobRect = [self rectForPart:NSScrollerKnob];
+ NSBezierPath *path = [NSBezierPath bezierPath];
+
+ NSPoint topLeft = NSMakePoint(NSMinX(knobRect) + 8.0, NSMinY(knobRect));
+ NSPoint bottomLeft = NSMakePoint(topLeft.x, NSMaxY(knobRect));
+ NSPoint topRight = NSMakePoint(NSMaxX(knobRect) - 8.0, topLeft.y);
+ NSPoint bottomRight = NSMakePoint(topRight.x, bottomLeft.y);
+
+ [path appendBezierPathWithArcWithCenter:NSMakePoint(topLeft.x, (topLeft.y + bottomLeft.y)/2) radius:(bottomLeft.y - topLeft.y)/2 startAngle:90 endAngle:270];
+ [path appendBezierPathWithArcWithCenter:NSMakePoint(topRight.x, (topRight.y + bottomRight.y)/2) radius:(bottomRight.y - topRight.y)/2 startAngle:-90 endAngle:90];
+ [path moveToPoint:bottomLeft];
+ [path lineToPoint:bottomRight];
+
+ NSBezierPath *knobPath = path;
+
+ [[NSGraphicsContext currentContext] saveGraphicsState];
+ [knobPath addClip];
+
+ // Draw the background
+ NSColor *outlineColor = [NSColor colorWithCalibratedWhite:1.0 alpha:0.5];
+ NSColor *bgTop = [NSColor colorWithCalibratedWhite:0.1 alpha:1.0];
+ NSColor *bgBottom = [NSColor colorWithCalibratedWhite:0.0 alpha:1.0];
+
+ // Draw the background
+ NSGradient *bgGradient = [[NSGradient alloc] initWithStartingColor:bgTop endingColor:bgBottom];
+ [bgGradient drawInBezierPath:knobPath angle:90.0];
+ [bgGradient release];
+
+ // Draw the gloss
+ NSColor *glossTop = [NSColor colorWithCalibratedWhite:1.0 alpha:0.3];
+ NSColor *glossBottom = [NSColor colorWithCalibratedWhite:1.0 alpha:0.1];
+ NSGradient *glossGradient = [[NSGradient alloc] initWithStartingColor:glossTop endingColor:glossBottom];
+ NSRect glossRect = [self rectForPart:NSScrollerKnob];
+ glossRect.origin.x += 4.0;
+ glossRect.size.width -= 8.0;
+ glossRect.size.height /= 2.0;
+ NSBezierPath *glossPath = [NSBezierPath bezierPathWithRoundedRect:glossRect xRadius:8.0 yRadius:4.0];
+ [glossGradient drawInBezierPath:glossPath angle:90.0];
+ [glossGradient release];
+
+ [knobPath setLineWidth:2.0];
+
+ [outlineColor set];
+ [knobPath stroke];
+
+ [[NSGraphicsContext currentContext] restoreGraphicsState];
+}
+
+- (NSRect)_drawingRectForPart:(NSScrollerPart)aPart
+{
+ // Super's implementation has some side effects
+ [super _drawingRectForPart:aPart];
+
+ // Return the appropriate rectangle
+ return [self rectForPart:aPart];
+}
+
+- (NSBezierPath *)_leftArrowPath
+{
+ NSRect arrowRect = [self rectForPart:NSScrollerDecrementLine];
+ NSBezierPath *path = [NSBezierPath bezierPath];
+
+ NSPoint topLeft = NSMakePoint(NSMinX(arrowRect) + 8.0, NSMinY(arrowRect));
+ NSPoint bottomLeft = NSMakePoint(topLeft.x, NSMaxY(arrowRect));
+ NSPoint topRight = NSMakePoint(NSMaxX(arrowRect), topLeft.y);
+ NSPoint bottomRight = NSMakePoint(topRight.x, bottomLeft.y);
+
+ [path appendBezierPathWithArcWithCenter:NSMakePoint(topLeft.x, (topLeft.y + bottomLeft.y)/2) radius:(bottomLeft.y - topLeft.y)/2 startAngle:90 endAngle:270];
+ [path lineToPoint:topRight];
+ [path lineToPoint:bottomRight];
+ [path moveToPoint:topRight];
+ [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(arrowRect), (topRight.y + bottomRight.y)/2) radius:(bottomRight.y - topRight.y)/2 startAngle:90 endAngle:270];
+ [path moveToPoint:bottomRight];
+ [path lineToPoint:bottomLeft];
+ [path setWindingRule:NSEvenOddWindingRule];
+ [path closePath];
+
+ return path;
+}
+
+- (NSBezierPath *)_rightArrowPath
+{
+ NSRect arrowRect = [self rectForPart:NSScrollerIncrementLine];
+ NSBezierPath *path = [NSBezierPath bezierPath];
+
+ NSPoint topLeft = NSMakePoint(NSMinX(arrowRect), NSMinY(arrowRect));
+ NSPoint bottomLeft = NSMakePoint(topLeft.x, NSMaxY(arrowRect));
+ NSPoint topRight = NSMakePoint(NSMaxX(arrowRect)-8.0, topLeft.y);
+ NSPoint bottomRight = NSMakePoint(topRight.x, bottomLeft.y);
+
+ [path appendBezierPathWithArcWithCenter:NSMakePoint(topRight.x, (topRight.y + bottomRight.y)/2) radius:(bottomRight.y - topRight.y)/2 startAngle:-90 endAngle:90];
+ [path lineToPoint:bottomLeft];
+ [path lineToPoint:topLeft];
+ [path moveToPoint:bottomLeft];
+ [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(arrowRect), (topLeft.y + bottomLeft.y)/2) radius:(bottomLeft.y - topLeft.y)/2 startAngle:270 endAngle:90];
+ [path moveToPoint:topLeft];
+ [path lineToPoint:topRight];
+ [path setWindingRule:NSEvenOddWindingRule];
+ [path closePath];
+
+ return path;
+}
+
+/*- (NSScrollerPart)hitPart
+{
+ return [self testPart:[[NSApp currentEvent] locationInWindow]];
+}*/
+
+@end
View
4 MBCoverFlowView.h
@@ -9,6 +9,8 @@
#import <Cocoa/Cocoa.h>
#import <QuartzCore/QuartzCore.h>
+@class MBCoverFlowScroller;
+
@interface MBCoverFlowView : NSView {
NSInteger _selectionIndex;
@@ -26,6 +28,8 @@
NSArray *_content;
NSViewController *_accessoryController;
+
+ MBCoverFlowScroller *_scroller;
}
/**
View
26 MBCoverFlowView.m
@@ -8,6 +8,7 @@
#import "MBCoverFlowView.h"
+#import "MBCoverFlowScroller.h"
#import "NSImage+MBCoverFlowAdditions.h"
#import <QuartzCore/QuartzCore.h>
@@ -22,6 +23,10 @@
const float MBCoverFlowViewDefaultItemHeight = 100.0;
const float MBCoverFlowViewTopMargin = 30.0;
+const float MBCoverFlowViewBottomMargin = 20.0;
+
+const float MBCoverFlowScrollerHorizontalMargin = 80.0;
+const float MBCoverFlowScrollerVerticalSpacing = 16.0;
#define MBCoverFlowViewContainerMinY (NSMaxY([self.accessoryController.view frame]) - 3*[self itemSize].height/4)
@@ -55,6 +60,12 @@ - (id)initWithFrame:(NSRect)frameRect
if (self = [super initWithFrame:frameRect]) {
[self setAutoresizesSubviews:YES];
+ // Create the scroller
+ _scroller = [[MBCoverFlowScroller alloc] initWithFrame:NSMakeRect(10, 10, 400, 16)];
+ [_scroller setKnobProportion:1.0];
+ [_scroller setEnabled:YES];
+ [self addSubview:_scroller];
+
_leftTransform = CATransform3DMakeRotation(-0.79, 0, -1, 0);
_rightTransform = CATransform3DMakeRotation(MBCoverFlowViewPerspectiveAngle, 0, -1, 0);
@@ -198,6 +209,7 @@ - (id)initWithFrame:(NSRect)frameRect
- (void)dealloc
{
+ [_scroller release];
[_scrollLayer release];
[_containerLayer release];
self.accessoryController = nil;
@@ -254,10 +266,22 @@ - (void)viewWillMoveToSuperview:(NSView *)newSuperview
- (void)resizeSubviewsWithOldSize:(NSSize)oldSize
{
+ // Reposition the scroller
+ NSRect scrollerFrame = [_scroller frame];
+ scrollerFrame.size.width = [self frame].size.width - 2*MBCoverFlowScrollerHorizontalMargin;
+ scrollerFrame.origin.x = ([self frame].size.width - scrollerFrame.size.width)/2;
+ scrollerFrame.origin.y = MBCoverFlowViewBottomMargin;
+ [_scroller setFrame:scrollerFrame];
+ if ([[self content] count]) {
+ [_scroller setKnobProportion:(1.0/[[self content] count])];
+ } else {
+ [_scroller setKnobProportion:1.0];
+ }
+
if (self.accessoryController.view) {
NSRect accessoryFrame = [self.accessoryController.view frame];
accessoryFrame.origin.x = floor(([self frame].size.width - accessoryFrame.size.width)/2);
- accessoryFrame.origin.y = 40.0;
+ accessoryFrame.origin.y = NSMaxY([_scroller frame]) + MBCoverFlowScrollerVerticalSpacing;
[self.accessoryController.view setFrame:accessoryFrame];
}
View
6 MBCoverFlowView.xcodeproj/project.pbxproj
@@ -11,6 +11,7 @@
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+ C91E73FC0F79F75C00FD319E /* MBCoverFlowScroller.m in Sources */ = {isa = PBXBuildFile; fileRef = C91E73FB0F79F75C00FD319E /* MBCoverFlowScroller.m */; };
C9D1735A0F6B38CD0097827F /* MBCoverFlowView.m in Sources */ = {isa = PBXBuildFile; fileRef = C9D173590F6B38CD0097827F /* MBCoverFlowView.m */; };
C9D1737A0F6B3ADC0097827F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9D173790F6B3ADC0097827F /* QuartzCore.framework */; };
C9D178230F6F97D60097827F /* MBCoverFlowViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9D178220F6F97D60097827F /* MBCoverFlowViewController.m */; };
@@ -28,6 +29,8 @@
32CA4F630368D1EE00C91783 /* MBCoverFlowView_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBCoverFlowView_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* MBCoverFlowView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MBCoverFlowView.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ C91E73FA0F79F75C00FD319E /* MBCoverFlowScroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBCoverFlowScroller.h; sourceTree = "<group>"; };
+ C91E73FB0F79F75C00FD319E /* MBCoverFlowScroller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBCoverFlowScroller.m; sourceTree = "<group>"; };
C9D173580F6B38CD0097827F /* MBCoverFlowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBCoverFlowView.h; sourceTree = "<group>"; };
C9D173590F6B38CD0097827F /* MBCoverFlowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBCoverFlowView.m; sourceTree = "<group>"; };
C9D173790F6B3ADC0097827F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
@@ -59,6 +62,8 @@
C9D178220F6F97D60097827F /* MBCoverFlowViewController.m */,
C9E9ACB40F78B188004DDC0A /* NSImage+MBCoverFlowAdditions.h */,
C9E9ACB50F78B188004DDC0A /* NSImage+MBCoverFlowAdditions.m */,
+ C91E73FA0F79F75C00FD319E /* MBCoverFlowScroller.h */,
+ C91E73FB0F79F75C00FD319E /* MBCoverFlowScroller.m */,
);
name = Classes;
sourceTree = "<group>";
@@ -189,6 +194,7 @@
C9D1735A0F6B38CD0097827F /* MBCoverFlowView.m in Sources */,
C9D178230F6F97D60097827F /* MBCoverFlowViewController.m in Sources */,
C9E9ACB60F78B188004DDC0A /* NSImage+MBCoverFlowAdditions.m in Sources */,
+ C91E73FC0F79F75C00FD319E /* MBCoverFlowScroller.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
2  MBCoverFlowViewController.m
@@ -37,6 +37,8 @@ - (void)awakeFromNib
NSTextField *label = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 10, 10)];
[label setBordered:NO];
[label setBezeled:NO];
+ [label setEditable:NO];
+ [label setSelectable:NO];
[label setObjectValue:@"Test"];
[label setDrawsBackground:NO];
[label setTextColor:[NSColor whiteColor]];
Please sign in to comment.
Something went wrong with that request. Please try again.