Paste: NSNotification
Author: | gre |
Mode: | factor |
Date: | Thu, 6 Dec 2018 19:58:18 |
Plain Text |
USING: cocoa cocoa.application cocoa.classes kernel locals ;
IN: notifications.macos
IMPORT: NSUserNotification
IMPORT: NSUserNotificationCenter
:: make-notification ( title text url -- notification )
NSUserNotification -> alloc -> init -> autorelease
[ title <NSString> -> setTitle: ] keep
[ text <NSString> -> setInformativeText: ] keep ;
: send-notification ( title text url -- )
make-notification
[
NSUserNotificationCenter -> defaultUserNotificationCenter
] dip
-> deliverNotification: ;
New Annotation