Pregunta

I'm currently working on a file-manager with vala and clutter and i was wondering is it possible to display GLib.Icon ( Fileinfo.get_icon() ) in Clutter.Image instead of just displaying one folder icon from it's location?

¿Fue útil?

Solución

If the icon is a GLib.LoadableIcon you should be able to use GLib.LoadableIcon.load to get a GLib.InputStream, then us that to create a Gdk.Pixbuf with Gdk.Pixbuf.from_stream. From there use Clutter.Image.set_data to copy the data into the Clutter.Image.

To test whether the icon is a GLib.LoadableIcon, just do something like GLib.LoadableIcon loadable_icon = icon as GLib.LoadableIcon; if (loadable_icon != null) { ... }

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top