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
评论列表
文章目录