Re: Displaying messages through notification centre

Ned Deily <[email protected]>
Newsgroups gmane.comp.python.apple
Message-ID <[email protected]>
In article 
<CACgdh2gj+VD9yGA-HCRv8y=ov7DQC8b9iwQ3rLGyrwgL7z+Hsg@mail.gmail.com>,
 Paul Wiseman <[email protected]> wrote:
> I've got an app which at the moment displays custom drawn tray style
> notifications.
> 
> The app targets OSX 10.5+. I want to start looking at showing these
> messages/notifications through the native notification centre for users on
> systems that support it (10.8+).
> 
> I have a few questions on how to do this. It looks like this should be
> possible by creating the correct object
> <https://developer.apple.com/library/mac/documentation/Foundation/Reference/NS
> UserNotification_Class/>through
> pyobjc. Will it be possible to just include the bits of pyobjc in my final
> app that I need to create the notifications? I'd rather not include the
> whole of pyobjc just for this one bit of functionality if I can avoid it.
> If so how might I got about separating the unused parts of the library out
> (I'm using py2app)

If you don't get an answer here, you should try the pyobjc list:

https://lists.sourceforge.net/lists/listinfo/pyobjc-dev

Another simple-minded possibility: use the AppleScript "display 
notification" command by "shelling out" from your app to osascript:

http://apple.stackexchange.com/questions/57412/how-can-i-trigger-a-notifi
cation-center-notification-from-an-applescript-or-shel

-- 
 Ned Deily,
 [email protected]

_______________________________________________
Pythonmac-SIG maillist  -  [email protected]
https://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.