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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -