GIO:get_icon() 始终返回 None
根据GIO文档,可以通过g_file_info_get_icon()获取文件的Icon http://developer.gnome.org/gio /stable/GFileInfo.html#g-file-info-get-icon
但这不起作用,看看这个示例:
print(somefile) # <FileInfo object at 0x17bf820 (GFileInfo at 0x1b15d00)>
icon = somefile.get_icon()
print(icon) # always None
if icon is Gio.Icon:
print("isicon") # never happens
我已经用我的整个主文件夹测试了它, get_icon() 总是返回 没有任何。我是否犯了任何错误,或者这个函数根本无法与 python / pygobject 一起使用?
According to the GIO Documentation, it is possible to get the Icon of a file through g_file_info_get_icon ()
http://developer.gnome.org/gio/stable/GFileInfo.html#g-file-info-get-icon
But this doesnt work, take a look at this sample:
print(somefile) # <FileInfo object at 0x17bf820 (GFileInfo at 0x1b15d00)>
icon = somefile.get_icon()
print(icon) # always None
if icon is Gio.Icon:
print("isicon") # never happens
I've testet it with my whole home folder, get_icon() does ALWAYS return None. Did i made any mistakes or is this function simply not working with python / pygobject?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您query_info standard::icon 属性?例如,
Did you query_info the standard::icon attribute? For example,