pythonpython-3.xgtkgtk3gdkpixbuf

GTK - Python Pixbuf From List


I got icon data into a Python list. How could I get this icon data into pixbuf? I could not find it in this source.

Here is the code I get icon data:

from gi.repository import Gio

apps = Gio.AppInfo.get_all()
icon = apps[0].get_icon()
print(icon)

Python 3, GTK3, OS: Debian-like Linux.


Solution

  • I could not find how to get Gio.AppInfo icons into pixbuf, but I solved my problem in another way.

    I have found Desktop application files in the /usr/share/applications/ location. I could get specific application icon by reading .desktop file of it. Fİnally I could get the icon into pixbuf by using new_from_file() command.