i'm trying to load a folder icon as a texture. i have tried almost everything now and i can't get it to work for some reason
i think this thread is just what i'm looking for but it's too advanced. i want it simple for now.
and for some reason i can't get this to work / translate it.
this is the code i have ended up with. don't know what to do now.
class nicholas
{
Gtk.Window window;
GtkClutter.Embed clutter;
Clutter.Rectangle r;
Clutter.Texture t;
public nicholas ()
{
window = new Gtk.Window ();
clutter = new GtkClutter.Embed ();
var stage = clutter.get_stage () as Clutter.Stage;
stage.background_color = Clutter.Color.from_string ("black");
var o = new Cogl.Texture.from_file("/usr/share/icons/gnome/48x48/places/folder.png", Cogl.TextureFlags.NONE, Cogl.PixelFormat.ANY);
t = new Clutter.Texture.set_cogl_texture(o);
t.x = 80;
t.y = 80;
stage.add_child (t);
window.add (clutter);
window.destroy.connect (Gtk.main_quit);
window.set_default_size (500, 300);
window.show_all ();
}
}
public static void main (string [] args)
{
GtkClutter.init (ref args);
nicholas nicholas = new nicholas ();
Gtk.main ();
}