This customized code from cocoa controls….The url for the source is https://github.com/levey/AwesomeMenu