Page 1 of 1

Using growl from a pure C application

Posted: Tue Nov 13, 2007 10:47 pm
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

Posted: Wed Nov 14, 2007 6:43 am
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.

Posted: Wed Nov 14, 2007 8:56 am
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.

Posted: Wed Nov 14, 2007 9:22 am
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.

Posted: Sat Nov 17, 2007 10:09 am
by SuperFLoh
Well, it growls :-)

Flo