Simple example project?
-
CompiledMonkey
- Harmless
- Posts: 5
- Joined: Tue Nov 07, 2006 6:11 am
- Location: Richmond, VA
- Contact:
Simple example project?
Is there a simple example out there on how to use growl? I'm not getting anywhere with the current docs.
Chris Stewart
http://www.compiledmonkey.com
http://www.compiledmonkey.com
-
CompiledMonkey
- Harmless
- Posts: 5
- Joined: Tue Nov 07, 2006 6:11 am
- Location: Richmond, VA
- Contact:
&OK, here's what I have currently. The error I'm getting at run time is: "*** Uncaught exception: <NSInvalidArgumentException> *** +[GrowlApplicationBridge notifyWithTitle:description:notificationName:]: selector not recognized". Any idea what I'm doing wrong?
GrowlController.h
GrowlController.m
main.m
GrowlController.h
Code: Select all
#import <Cocoa/Cocoa.h>
#import <Growl-WithInstaller/Growl.h>
@interface GrowlController: NSObject<GrowlApplicationBridgeDelegate>
{
}
@end
Code: Select all
#import "GrowlController.h"
#define SampleNotificationName @"The HelloGrowl Sample Notification"
#define GROWL_NOTIFICATION_DEFAULT @"NotificationDefault;
@implementation GrowlController
- (void) awakeFromNib {
[GrowlApplicationBridge setGrowlDelegate:self];
//[GrowlApplicationBridge reregisterGrowlNotifications];
//NSDictionary *prefsDict = [[NSDictionary alloc] initWithContentsOfFile:GROWL_PREFS_PATH];
//[growlLoggingButton setState:[[prefsDict valueForKey:@"GrowlLoggingEnabled"] intValue]];
}
- (NSString *)applicationNameForGrowl {
return @"BeepHammer";
}
- (NSDictionary *) registrationDictionaryForGrowl
{
NSArray *notifications = [NSArray arrayWithObjects:
SampleNotificationName,
nil];
NSDictionary *regDict = [NSDictionary dictionaryWithObjectsAndKeys:
@"Weather", GROWL_APP_NAME,
notifications, GROWL_NOTIFICATIONS_ALL,
notifications, GROWL_NOTIFICATIONS_DEFAULT,
nil];
return regDict;
}
- (void) sendMessage {
[GrowlApplicationBridge notifyWithTitle:"Title"
description:"Description"
notificationName:SampleNotificationName];
}
@end
Code: Select all
#import <Cocoa/Cocoa.h>
#import "GrowlController.h"
int main(int argc, char *argv[])
{
GrowlController *cont = [[GrowlController alloc] init];
[cont sendMessage];
return NSApplicationMain(argc, (const char **) argv);
}
Chris Stewart
http://www.compiledmonkey.com
http://www.compiledmonkey.com