Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7076541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:18:38+00:00 2026-05-28T06:18:38+00:00

I’m working on a small wrapper for the Growl 1.3.1 SDK. More specifically, I’d

  • 0

I’m working on a small wrapper for the Growl 1.3.1 SDK. More specifically, I’d like to package Growl in my application so that even if the user doesn’t have Growl, they will still be able to get notifications. I previously had Growl installed and my code would fire a notification. I have since uninstalled Growl and am using just the framework; Mist, I believe it is called. However, when I launch the code now (that Growl is uninstalled), no notification is fired! Below is the code I am currently working with:

#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;
}

I also have the appropriate Growl Registration dictionary, and am compiling with:

g++ growlwrapper.mm -framework Growl -framework Foundation -o growltest

Is there anything wrong with this code? Any ideas why it wouldn’t be firing?


Edit: Seems the code above is working just fine. Just needed to be in a run loop, with the appropriate Growl dictionary stuff.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:18:39+00:00Added an answer on May 28, 2026 at 6:18 am

    I’m not an authority on Growl, but I have a pretty good hunch: When the Growl app is installed, a one-shot notification like this has a prayer to work, because the running app has a run loop and can drive UI from it. In the example you have here, there’s no run loop, so there’s no way for this one-shot app to ever draw any notifications — it’s dead before it even has a chance. I would guess if you made a boilerplate Cocoa app, and then called showGrowlMessage from applicationDidFinishLaunching:, but before you terminated/quit the app, I bet it would work. At the very least you should give that a try.

    EDIT: If you create a new Cocoa non-document application, and add the following methods to the appDelegate class, it will successfully display a notification using the Mist (i.e. in-app) Growl.

    @implementation SOAppDelegate
    
    @synthesize window = _window;
    
    - (void)showGrowlMessageTitled: (NSString*)title description:(NSString*) desc
    {
        NSLog(@"[Growl] showGrowlMessage() called.");
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
        [GrowlApplicationBridge notifyWithTitle: title
                                    description: desc
                               notificationName: @"Upload"
                                       iconData: nil
                                       priority: 0
                                       isSticky: NO
                                   clickContext: nil];
        [pool drain];
    }
    
    
    - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
    {
        [GrowlApplicationBridge setGrowlDelegate: (NSObject<GrowlApplicationBridgeDelegate>*)self];
        [self showGrowlMessageTitled: @"Foo" description: @"Bar"];    
    }
    
    - (NSDictionary *) registrationDictionaryForGrowl
    {
        return [NSDictionary dictionaryWithObjectsAndKeys: 
                [NSArray arrayWithObject: @"Upload"], GROWL_NOTIFICATIONS_ALL,
                [NSArray arrayWithObject: @"Upload"], GROWL_NOTIFICATIONS_DEFAULT,
                nil];
    }
    
    @end
    

    So, in short, the problem with the original code was not only the runLoop problem, but that it was not passing a real delegate (i.e. object that implements the delegate methods described in the headers as required) to the GrowlApplicationBridge (it passes an empty string). You definitely still need a runLoop, but that’s not all — there’s additional, non-optional setup for using this framework.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
Specifically, suppose I start with the string string =hello \'i am \' me And

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.