cocoa - How to create alerts that look similar to OS X notifications? -


from alerts, i'm assuming picture represents panel, not sheet (my understanding sheets overlays on open apps).

i'm looking create custom, or built in 'clean' popup alert (notification). can't seem find within nsalert speaks of customizing alert - alerttype seems might apparently conveying importance.

an example this:

enter image description here

(source: http://i.stack.imgur.com/wjhv8.jpg)

the nsusernotificationcenter class used present these "user notifications" in upper-right of screen:

notification example

import appkit  let note = nsusernotification() note.title = "hi stack overflow" note.subtitle = "how’s going?" note.contentimage = nsimage(contentsofurl: nsurl(string: "http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png")!)  nsusernotificationcenter.defaultusernotificationcenter().delivernotification(note) 

(the 1 see gmail custom non-standard notification system chrome provides. can take advantage of if write chrome extension, nsusernotificationcenter more normal.)


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -