我希望使用系统默认的已知任务图标(复制、剪切、粘贴、新建文件、打开文件、退出、帮助等)。这取决于桌面环境中当前使用的图标集和/或所使用的操作系统。
Python是否提供了一种平台无关的方法来获取这些图标?
以下是基于Tkinter的伪代码:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from tkinter import *
from tkinter import ttk
from PIL import *
root = Tk()
image = image.open(DEFAULT_COPY_ICON)
image = ImageTk.PhotoImage(image)
button = Button(master=root, text='Copy', image=image))
root.mainloop()
PyGTK
有系统图标的名称,但可能只适用于 Linux。但是PyGTK
不是Tkinter
。 - furas