/*hello.vala compile : valac --pkg gtk+-3.0 --pkg glib-2.0 --tread helloworld.vala */ using Gtk; using GLib; public string[] icons; public IconTheme theme; public ListStore liststore; public Label label1; void* gen_list(){ string[] choices={"face","stock","emblem","gnome","application"}; string[] badicons={"gnome-spinner","gnome-panel-separator"}; string[] data ={}; foreach (string icon in icons ){ foreach (string choice in choices){ if (choice in icon && !( icon in badicons) && !(icon in data)) { print(@"$icon"); data += icon; TreeIter iter; var pixbuf = theme.load_icon(icon, 48, 0); liststore.append (out iter); liststore.set(iter,0,pixbuf); label1.hide(); }; }; }; return liststore; } int main (string[] args) { Gtk.init (ref args); Gtk.Builder builder = new Gtk.Builder (); builder.add_from_file ("helloworld.ui"); var window = builder.get_object ("window") as Gtk.Window; var liststore = builder.get_object ("liststore") as Gtk.ListStore; var icon_view = builder.get_object ("iconview1") as Gtk.IconView; var label1 = builder.get_object ("label1") as Gtk.Label; icon_view.set_pixbuf_column (0); builder.connect_signals (null); var theme = new Gtk.IconTheme(); theme.set_custom_theme("ubuntu-mono-dark"); var icons=theme.list_icons(null); Thread.create(gen_list,false); window.show_all (); Gtk.main (); return 0; }