I'm writing a platform-independent Python application. For now it runs on Linux and OSX. However, I want to integrate platform-specific code. To be more precise I want to use the native notification systems (Growl, Mountain Lion's notification center, GNOME notifications).
So far I managed to integrate the GNOME notifications. The Mountain Lion notifications work fine so far as I used PyObjC to send them. And here is the big problem I ran into:
In order for PyObjC to work properly I need to invoke AppHelper.runEventLoop()
. Otherwise, I could send the notifications but I would not be able to react upon clicks on the notifications or anything else that requires the Cocoa libraries to call back my script. But as my application is supposed to be platform independent AppHelper.runEventLoop()
is not my desired event loop. I should mention that, despite the notifications, my application is not a GUI application and has in fact its own event loop.
I tried to create an extra thread to run the Cocoa event loop in, without success.
Any ideas?