Search code examples
python-3.xgtk3pygobject

How to instantiate GIcon


I need to show an icon on Gio.MenuItem with set_icon() method. But set_icon() expects to receive a GIcon object. How to create a GIcon object?


Solution

  • Gio.Icon is just an interface. It is implemented by Gio.ThemedIcon, Gio.FileIcon, Gio.BytesIcon, etc. So you would would use those.