Very raw port to AppKit