Growl1.3.1SDKの小さなラッパーに取り組んでいます。具体的には、Growlをアプリケーションにパッケージ化して、ユーザーがGrowlを持っていなくても、通知を受け取ることができるようにします。以前にGrowlをインストールしていましたが、コードで通知が発生しました。それ以来、Growlをアンインストールし、フレームワークのみを使用しています。ミスト、それは呼ばれていると思います。ただし、今すぐコードを起動すると(Growlがアンインストールされている)、通知は発行されません。以下は私が現在使用しているコードです:
#import "growlwrapper.h"
void showGrowlMessage(std::string title, std::string desc) {
std::cout << "[Growl] showGrowlMessage() called." << std::endl;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[GrowlApplicationBridge setGrowlDelegate: @""];
[GrowlApplicationBridge
notifyWithTitle: [NSString stringWithUTF8String:title.c_str()]
description: [NSString stringWithUTF8String:desc.c_str()]
notificationName: @"Upload"
iconData: nil
priority: 0
isSticky: NO
clickContext: nil
];
[pool drain];
}
int main() {
showGrowlMessage("Hello World!", "This is a test of the growl system");
return 0;
}
私は適切な唸り声登録辞書も持っており、コンパイルしています:
g++ growlwrapper.mm -framework Growl -framework Foundation -o growltest
このコードに何か問題がありますか?なぜそれが発火しないのか、何か考えはありますか?
編集:上記のコードは問題なく機能しているようです。適切なGrowlディクショナリを使用して、実行ループに入る必要がありました。