Re: Growl Support?
Re: Growl Support?
- Subject: Re: Growl Support?
- From: "Chris Lewis" <email@hidden>
- Date: Fri, 24 Feb 2006 10:02:34 +0000
http://www.growl.info/documentation/developer/implementing-growl.php?lang=cocoa
This web page taught me everything I needed to know to get a Growl
implementation in a stupid program I wrote, here's the source for the
Growl methods:
- (id)init
{
[super init];
NSLog(@"init");
speechSynth = [[NSSpeechSynthesizer alloc] initWithVoice:nil];
[speechSynth setDelegate:self];
[GrowlApplicationBridge setGrowlDelegate:self];
return self;
}
- (IBAction)sayIt:(id)sender
{
NSString *string = [textField stringValue];
if ([string length] == 0)
{
return;
}
[speechSynth startSpeakingString:string];
[stopButton setEnabled:YES];
[startButton setEnabled:NO];
[GrowlApplicationBridge
notifyWithTitle:@"Started speaking"
description:@"I'm speaking"
notificationName:@"speaking"
iconData:nil
priority:0
isSticky:NO
clickContext:nil];
NSLog(@"Have started to say %@", string);
}
- (NSDictionary *) registrationDictionaryForGrowl
{
NSArray *theNotification = [NSArray arrayWithObject:@"speaking"];
return [NSDictionary dictionaryWithObjectsAndKeys:
theNotification, GROWL_NOTIFICATIONS_ALL,
theNotification, GROWL_NOTIFICATIONS_DEFAULT, nil];
}
HTH
Chris
On 2/23/06, themacuser <email@hidden> wrote:
> I'll download the Cyberduck sources and see how he does it. It would
> be helpful if the growl team made a small app that registers itself
> with growl on launch, and gives a growl alert of "hello world" when
> you press a button.
>
> I am tempted to use my previous learning about NSTask to just use the
> CLI growlnotify, but that's a bit hackish.
>
> On 23/02/2006, at 9:41 PM, Uli Kusterer wrote:
>
> > Am 23.02.2006 um 08:42 schrieb themacuser:
> >> This isn't the header. This is GrowlDelegate.m.
> >
> > Check the code you posted (not the initial one, the changed one
> > which includes both @implementation and @interface). Both of them
> > include the header. You have an @interface that includes itself.
> >
> > It's not very polite to claim something to someone trying to help
> > you without actually verifying that person is wrong.
>
> I don't see what you mean - I did verify that I had the right file.
> The titlebar says GrowlDelegate.m, not GrowlDelegate.h - does that
> mean I am editing the implementation file not the header file? I'm
> sure it does.
> >
> > Cheers,
> > -- M. Uli Kusterer
> > http://www.zathras.de
> >
> >
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden