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:
(source: http://i.stack.imgur.com/wjhv8.jpg)
the nsusernotificationcenter class used present these "user notifications" in upper-right of screen:
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
Post a Comment