groups

name language licence
kqueues C Other
Method Replacement (swizzle) Objective-C Other
Safe respondsToSelector: override Objective-C Other
Convert NSScreen visibleFrame to screen coordinates Objective-C Other
Printing callstacks Objective-C Other
Draw single-pixel on top of splitview Objective-C Other
raw fsevents C Other
NSCollectionView Finding View Items in mouseDown: Objective-C Other

< 1 2 3 4 >



language: Objective-C
licence: Other

Draw single-pixel on top of splitview

options: view full snippetsend to code collector
@implementation CustomEnclosingSplitview

-(void) drawRect:(NSRect)rect
{
	[super drawRect:rect];
	
	// All of this below draws the single-pixel line at the top of the outer splitview.
	NSRect tgtRect = [self frame];
	NSBezierPath *path = [NSBezierPath bezierPath];
	[path setLineWidth:0];
	
	[path moveToPoint:NSMakePoint( NSMinX( tgtRect ), NSMinY( tgtRect ) + (.5 / [[self window] userSpaceScaleFactor]) )];
	[path lineToPoint:NSMakePoint( NSMaxX( tgtRect ), NSMinY( tgtRect ) + (.5 / [[self window] userSpaceScaleFactor]) )];
	
	[[NSColor colorWith8BitRed:165 green:165 blue:165 alpha:1.0] set];
	
(Continues...)