python - 如何在菜单项中显示图标?

标签 python menu gtk pygtk menuitem

我知道如何创建纯文本菜单项:

item = gtk.MenuItem('text')

但是我怎样才能显示图标呢?

像这样:

alt text

最佳答案

只需使用 ImageMenuItem 而不是 MenuItem

这是一个例子:http://zetcode.com/tutorials/pygtktutorial/menus/

关于python - 如何在菜单项中显示图标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4318703/

相关文章:

html - 通过使用 javascript 在类中添加一个词来单击按钮时为菜单添加/删除 [toggle]

c - GTK非标准输入

Python Tkinter。数据点的最佳拟合椭圆

python - 从 Python 中的字符串中提取字段和值

c# - 带有填充的菜单项的悬停问题

python - 在 Ubuntu 上使用 PyGObject 在 python 中进行 Gtk 拼写检查

c# - 你如何检查一个窗口是否在 Gtk 中最大化?

python - 在 virtualenv : module 'tensorflow' has no attribute 'truncated_normal' 中运行tensorflow时出错

python - 使用 Python 从 REST API 获取大型分页数据

css - 在桌面上隐藏一个div