Cryptite
Cryptite

Reputation: 1466

Windows Balloon-tooltips in Python

Following the example at http://article.gmane.org/gmane.comp.python.general/541418, I've succeeded in creating a callable class for balloon tooltips, but the greater complexities of that code elude me when it comes to customization. I browsed a bit of how it works through msdn, but being a novice at more windows-esque languagues like c and vb, etc. I was unable to make much sense of it.

So I ask ye snakely academics:

Things I'd like to be able to do with that code aside from the standard icon, title, text:

Ideally I'd get some sort of return value or some semblance of an event when the tooltip is clicked so that I could run some code, but currently I'm importing that code as a module and calling at various times, so I'm not sure how to handle clicks outside of the popup code itself...

Information on handling these things with python seems quite scarce. Thanks in advance.

Upvotes: 0

Views: 2819

Answers (2)

hildogjr
hildogjr

Reputation: 876

On Linux and Unix systems I use the notify-send OS already implemented system.

import os
os.system('notify-send "'+title+'" "'+message+'")

Maybe in Windows there is some API32 for this.

Check this https://gist.github.com/wontoncc/1808234

Upvotes: 0

rioki
rioki

Reputation: 6118

  • Perform actions based on clicking the tooltip

Whats the problem OnTaskbarNotify? Hock yourself in there.

  • Modify the tooltip that pops up over the icon in the system tray after loading it (to reflect changing values)

Probably not, I am not sure about the WinAPI here. I haven't seen it in the wild, so...

  • Multiple lines? (Not sure if this can even be done, really)

With most WinAPI, just insert a \n in the string.

  • More information on other things you could do in a windows 7 environment versus XP (which seems to be what this was written for).

LOTS... But that is a bit vague... It depends what your needs are. But for kol feturez you need to google on your own...

Upvotes: 0

Related Questions