• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Transparent window for messages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Transparent window for messages


  • Subject: Re: Transparent window for messages
  • From: Gregory Weston <email@hidden>
  • Date: Wed, 15 Mar 2006 07:05:53 -0500

Devraj Mukherjee wrote:

I wish to create transparent windows to display error messages, much
like the OSX volume control.

I got pointed out to the Growl project and to tell you the truth it
was a lot of Objective-C for me to understand.

Does anyone know of a simpler example that I can have a look at. Or
can someone send me some sample code.

Growl is fairly straightforward to use for simple notifications:

---------------------8<-----------------------
static NSString* kMyGrowlNotification = @"Some Event Happened";

@implementation MyGrowler

#pragma mark Growl Delegate

//  Growl will invoke these to find out about you.
- (NSString*)applicationNameForGrowl
{
  return @"Silica";
}

- (NSDictionary*)registrationDictionaryForGrowl
{
NSArray* theArray = [NSArray arrayWithObject:kMyGrowlNotification];
return [NSDictionary dictionaryWithObjectsAndKeys: theArray,
GROWL_NOTIFICATIONS_ALL, theArray, GROWL_NOTIFICATIONS_DEFAULT, nil];
}


#pragma mark NSObject Overrides

//  This lets Growl know you exist.
- (void)awakeFromNib
{
  [GrowlApplicationBridge setGrowlDelegate:self];
}

#pragma mark Interface

//  Here's the only published function of the growl interface object.
- (void)growlWithText:(NSString*)inMessage imageData:(NSData*)inImage
{
  [GrowlApplicationBridge notifyWithTitle:kMyGrowlNotification
                              description:inMessage
                         notificationName:kMyGrowlNotification
                                 iconData:inImage
                                 priority:0
                                 isSticky:NO
                             clickContext:nil];
}

@end
---------------------8<-----------------------

On the other hand, it's also not a terrible amount of work to do it yourself, and it reduces the footprint of your app and eliminates the requirement that your users have or are willing and able to install Growl.

<http://developer.apple.com/samplecode/RoundTransparentWindow/ RoundTransparentWindow.html> _______________________________________________
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
  • Prev by Date: Re: manually populating an NSTreeController
  • Next by Date: Re: slow QTKit framegrabbing
  • Previous by thread: Re: Transparent window for messages
  • Next by thread: Announcement: Free new Xcode book available as pdf
  • Index(es):
    • Date
    • Thread