开发者

Is it possible to change the title of a notification?

开发者 https://www.devze.com 2023-01-28 15:23 出处:网络
Is it possible to change the title of a pynotify.Notification? If so what is the method call to use? Also, it is possible to merge notifications using set_hint_string(\'append\', \'\'). Is it possibl

Is it possible to change the title of a pynotify.Notification? If so what is the method call to use?

Also, it is possible to merge notifications using set_hint_string('append', ''). Is it possible to开发者_如何学Go change a title and keep them merged.

I want something like the following (not real code, just a description of the effect) to happen:

Notification("Something is happening") + Notification("Something is happening") -> Notification("2 things are happening")


Perhaps use the update method:

import pynotify
import time   

pynotify.init('app name')
n=pynotify.Notification("title","Something is happening")
n.show()
time.sleep(2)
n.update("new title","2 things are happening")
n.show()
0

精彩评论

暂无评论...
验证码 换一张
取 消