使用 pygtk 的简单托盘图标应用程序
我正在用 python 编写一个网络邮件检查器,我希望它只是位于托盘图标上,并在有新电子邮件时警告我。 就 gtk 代码而言,有人能指出我正确的方向吗?
我已经编写了检查新电子邮件所需的代码,但现在是 CLI。
I'm writing a webmail checker in python and I want it to just sit on the tray icon and warn me when there is a new email. Could anyone point me in the right direction as far as the gtk code?
I already coded the bits necessary to check for new email but it's CLI right now.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您将需要使用 gtk.StatusIcon 来实际显示图标。 这里是文档。 如果您刚刚开始使用 GUI 编程,您可能需要学习一些 pygtk 教程< /a>.
You'll want to use a gtk.StatusIcon to actually display the icon. Here are the docs. If you're just getting started with gui programming you might want to work though a bit of the pygtk tutorial.
这个 http://www.pygtk.org/docs/pygtk/class-gtkstatusicon .html 应该可以帮助你。
This http://www.pygtk.org/docs/pygtk/class-gtkstatusicon.html should get you going.