Hello ...
NSEraseRect() just fills a rectangle with white; no transparency.
However, in checking that out, I ran across NSRectFillUsingOperation(NSRect aRect, NSCompositingOperation op). It's a "description forthcoming" function, but using NSCompositeClear for the operation seems to work just fine.
Thanks for the nudge ...
DayLateDon