问题
Various applications on Mac OS X display messages in a grey, transparent, rounded box overlay to notify the user of something; for example the "Build Succeeded" message in Xcode, the looped search message in the Lion inline-search bar and Chrome's "Warn Before Quitting" message.
An example of the message box I'm describing: http://2.bp.blogspot.com/-eG890NRhQbs/Ty0vLkqpBWI/AAAAAAAAAMs/PO2EbJ3lTs0/s1600/Xcode-11.png
As they're all very similar in formatting, it makes sense to assume there are some sort of standard functions for displaying a similar message. How can I have such an effect in my own Cocoa application?
回答1:
There isn't a public system API to do them.
You could have a look at Matt Gemmell's version: scroll down to RoundedFloatingPanel on this page.
Alternatively, if you want to Google for others, they're often known as Bezels. The private framework that draws the system ones is BezelServices.
来源:https://stackoverflow.com/questions/11969009/cocoa-grey-message-overlay