开发者

How to display a status message in the Gnome panel?

开发者 https://www.devze.com 2022-12-31 14:02 出处:网络
I have a Gnome applet I\'ve been working on. It is written in Python and it displays the progress of something in a small label.

I have a Gnome applet I've been working on. It is written in Python and it displays the progress of something in a small label.

My question is: what is the best way to display status notific开发者_运维问答ations to the user? On Ubuntu, I notice that whenever I connect to a network or adjust the volume, a black box appears in the upper-right corner. Is there a way to do something like that with Python?


You can use pynotify, there isn't much documentation but it's usage is pretty straightforward. Example:

import pynotify    
pynotify.Notification ("WiFi connection lost","","notification-network-wireless-disconnected")

See also: https://wiki.ubuntu.com/NotificationDevelopmentGuidelines

0

精彩评论

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