Python 3에서 PyGObject를 사용 중이고 진행률 표시 줄이있는 Notify.Notification
을 사용하여 알림을 표시하려고합니다. 진행 막대는 자체적으로/비동기 적으로 또는 다른 것으로 업데이트 할 필요가 없습니다. 수동으로 새 값을 설정 한 다음 알림을 표시 할 때만 업데이트 할 수 있습니다. 나는 당신이 그것을 바꿀 때 새로운 볼륨을 보여주는 볼륨 알림과 같은 것을 본다.Notify.Notification의 PyGObject 진행률 표시 줄
this과 같은 문서를 찾는 방법을 찾지 못했습니다. PyGObject를 사용하면 가능합니까? 또는이 동작을 허용하는 또 다른 Python 3 라이브러리가 있습니까?
import gi
gi.require_version('Notify', '0.7')
from gi.repository import Notify
def __init___(self):
...
Notify.init("Progress")
self.notification = Notify.Notification(summary='Progress', body='0%')
self.notification.set_image_from_pixbuf(notification_image)
...
def on_progress_update(self, progress):
...
self.notification.update('Progress', str(progress) + '%', None)
self.notification.show()
...