autoComplete.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:PyIDE 作者: raggesilver 项目源码 文件源码
def get_icon_for_type(self, _type):
        theme = Gtk.IconTheme.get_default()
        try:
            if 'symbolic' in icon_names[_type.lower()]:
                print('Symbolic')
                return theme.load_icon(icon_names[_type.lower()], 16, 0)
            else:
                print('Not symbolic')
                path = os.path.abspath(__file__).replace('modules/autoComplete.py', '')
                path = os.path.join(path, 'resources/icons/' + icon_names[_type.lower()] + '.svg')
                print(path)
                a = GdkPixbuf.Pixbuf.new_from_file_at_scale(path, 16, 16, True)
                print(type(a))
                return a
        except:
            try:
                return theme.load_icon(Gtk.STOCK_ADD, 16, 0)
            except:
                return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号