[pygtk] display a notification near of the trayicon

Danni Moiseyev isotop at gmail.com
Thu Oct 19 05:02:09 WST 2006


aSBjaGVja2VkIHRoYXQgb3V0LCBlZ2cudHJheWljb24uVHJheUljb24gaGFzIGEgZ2V0X3Bvc2l0
aW9uKCkgbWV0aG9kLCB3aGljaApyZXR1cm4geCx5LCBpIGZvdW5kIHRoZSBtZXRob2QgcXVpdGUg
dW5yZWxpYWJsZSwgaXQgc29tZXRpbWVzIGdhdmVzIG1lICgwLDApCmZyb20gc29tZSByZWFzb24s
IGhlcmUgaXMgdGhlIG5ldyBjb2RlOgoKIyEgL3Vzci9iaW4vcHl0aG9uCgppbXBvcnQgcHlndGsK
cHlndGsucmVxdWlyZSgiMi4wIikKaW1wb3J0IGd0ayxnb2JqZWN0CmltcG9ydCBlZ2cudHJheWlj
b24KCmNsYXNzIFRyYXlEZW1vbnN0cmF0aW9uOgogZGVmIGNsb3NlX2JhbGxvb24oc2VsZixhLGIp
OgogICBwcmludCAiY2xvc2luZyBiYWxsb29uLi4uIgogICBzZWxmLmJhbGxvb24uZGVzdHJveSgp
OwoKCiBkZWYgX19pbml0X18oc2VsZik6CiAgIHdpbmRvdyA9IGd0ay5XaW5kb3codHlwZT1ndGsu
V0lORE9XX1BPUFVQKTsKICAgc2VsZi5iYWxsb29uID0gd2luZG93OwogICBsYWJlbCA9IGd0ay5M
YWJlbCgiQmFsbG9vbiEhICAgXG5hbm90aGVyIHJvdyEiKTsKICAgZXZlbnRib3ggPSBndGsuRXZl
bnRCb3goKQogICBldmVudGJveC5zZXRfZXZlbnRzIChndGsuZ2RrLkJVVFRPTl9QUkVTU19NQVNL
KQogICBldmVudGJveC5jb25uZWN0KCJidXR0b24tcHJlc3MtZXZlbnQiLHNlbGYuY2xvc2VfYmFs
bG9vbikKICAgIyBjbG9zZSBiYWxsb29uIGlzIGZvciBjbG9zaW5nIHRoZSBiYWxsb29uLAogICAj
IHRoZSBzdGF0dXMgaWNvbiBpcyBrZXB0IGluIHNlbGYudH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