Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想用自定义文本创建一个 Gtk.StatusIcon 。理想情况下,我想将其附加到现有图像中,但纯文本也可以。我怎样才能做到这一点?
我看过一些关于获取 Gtk.Label 的 pixbuf 的帖子,但这些方法似乎已从 Gtk3 中删除(pixbuf_get_from_drawable)
我不认为这是可能的。状态图标不是小部件,图标将由窗口管理器缩放。即使您使用Cairo或PIL动态生成图像以用作图标 pixbuf,它也不会具有系统托盘中嵌入标签的效果。取而代之的是,它会变成其他图标大小的微小、不可读的文本。
Cairo
PIL