开发者

Finding file icon given a MIME type using GTK

开发者 https://www.devze.com 2022-12-29 20:32 出处:网络
Is there a way to find out which icon to use for a given MIME type, using GTK/pygtk开发者_Python百科?

Is there a way to find out which icon to use for a given MIME type, using GTK/pygtk开发者_Python百科?

I know about gio.File(filename).query_info("standard::icon").get_icon(), but I need to find the icon without having to read the file.


Try gio.content_type_get_icon(). E.g.:

>>> gio.content_type_get_icon ('text/python')
<gio.ThemedIcon at 0xb7d0f734: text-python, gnome-mime-text-python, text-x-generic>
0

精彩评论

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

关注公众号