I just discovered the NSRect helper functions in NSGeometry.h (i.e. NSMidX, NSMaxX, etc...)
These would have made some repetitive coding much easier. I knew about NSMak
Helper function to draw three part images with left cap, fill and right cap. Ideal for custom buttons
void NSDrawThreePartImage(NSRect frame,
NSImage *startCap,
NSImage *centerFill,
NSImage *endCap,
BOOL vertical,
NSCompositingOperation op,
CGFloat alphaFraction,
BOOL flipped
);
Also look for NSDrawNinePartImage