mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-13 11:38:19 +00:00
20 lines
804 B
Plaintext
20 lines
804 B
Plaintext
|
#import <Foundation/Foundation.h>
|
||
|
#import <Foundation/NSUserNotification.h>
|
||
|
#import <Cocoa/Cocoa.h>
|
||
|
#import "notification.h"
|
||
|
|
||
|
void CNotification::Notify(const char *pTitle, const char *pMsg)
|
||
|
{
|
||
|
NSString* pNsTitle = [NSString stringWithCString:pTitle encoding:NSUTF8StringEncoding];
|
||
|
NSString* pNsMsg = [NSString stringWithCString:pMsg encoding:NSUTF8StringEncoding];
|
||
|
|
||
|
NSUserNotification *pNotification = [[NSUserNotification alloc] autorelease];
|
||
|
pNotification.title = pNsTitle;
|
||
|
pNotification.informativeText = pNsMsg;
|
||
|
pNotification.soundName = NSUserNotificationDefaultSoundName;
|
||
|
|
||
|
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:pNotification];
|
||
|
|
||
|
[NSApp requestUserAttention:NSInformationalRequest]; // use NSCriticalRequest to annoy the user (doesn't stop bouncing)
|
||
|
}
|