notifications.macos: Notifications for macOS.
They don't seem to always pop up. I think the delegate needs to be set to respond to a message to always show the notification.travis-windows
parent
f879a012c5
commit
00fd59aa39
|
@ -0,0 +1 @@
|
||||||
|
Doug Coleman
|
|
@ -0,0 +1,19 @@
|
||||||
|
! Copyright (C) 2018 Doug Coleman.
|
||||||
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
USING: cocoa cocoa.application cocoa.classes kernel locals ;
|
||||||
|
IN: notifications.macos
|
||||||
|
|
||||||
|
IMPORT: NSUserNotification
|
||||||
|
IMPORT: NSUserNotificationCenter
|
||||||
|
|
||||||
|
:: make-notification ( title text -- notification )
|
||||||
|
NSUserNotification -> alloc -> init -> autorelease
|
||||||
|
[ title <NSString> -> setTitle: ] keep
|
||||||
|
[ text <NSString> -> setInformativeText: ] keep ;
|
||||||
|
|
||||||
|
: send-notification ( title text -- )
|
||||||
|
make-notification
|
||||||
|
[
|
||||||
|
NSUserNotificationCenter -> defaultUserNotificationCenter
|
||||||
|
] dip
|
||||||
|
-> deliverNotification: ;
|
|
@ -0,0 +1 @@
|
||||||
|
macosx
|
Loading…
Reference in New Issue