Using growl from a pure C application

The Growl forums have moved to Google Groups, this forum is read only.
Locked
SuperFLoh
Harmless
Posts: 4
Joined: Wed May 16, 2007 11:31 am

Using growl from a pure C application

Post by SuperFLoh »

Hi,

I have a pure c/c++ application (except for a small wrapper to initialize SDL) from which I'd like to use growl.

Notifications would be enough, no callbacks needed.

Unfortunately, I'm not very experienced with c and have no idea how to code obj-c.

Would anybody be willing to help me on my first steps to using growl from c code?

Regards

Florian
IngmarStein
Latté
Posts: 63
Joined: Fri Dec 03, 2004 5:35 pm

Post by IngmarStein »

Have a look at the source code of the growlnotify tool. Although it's an Objective-C program, most of it is written in plain C and should contain everything you need to get going.
User avatar
bgannin
Growl Team
Posts: 1817
Joined: Thu Dec 02, 2004 8:11 am
Location: ..here
Contact:

Post by bgannin »

IngmarStein wrote:Have a look at the source code of the growlnotify tool. Although it's an Objective-C program, most of it is written in plain C and should contain everything you need to get going.
Note: currently growlnotify (release and trunk) does not work well on Leopard, as listed in the Leopard compatibility thread.
Try my software!

#define ADIUMX pimp //by me
#define QUESTION ((2b) || (!2b))
Have you hugged a programmer today?
IngmarStein
Latté
Posts: 63
Joined: Fri Dec 03, 2004 5:35 pm

Post by IngmarStein »

Actually, the code path which doesn't use NSConnection (i.e. the pure C path which uses a distributed notification) works just fine. Apparently, the Leopard issues arise because growlnotify does not pump an event loop which wasn't required in earlier version of Mac OS X to use an NSConnection. It works fine it you use the "-w" (wait) parameter.
SuperFLoh
Harmless
Posts: 4
Joined: Wed May 16, 2007 11:31 am

Post by SuperFLoh »

Well, it growls :-)

Flo
Locked