hello i made this small app to view icons from the system in python and
i am porting it to vala
but i can't get it to work any ideas what i am missing ?

Attachment: helloworld.ui
Description: application/designer

/*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<void*>(gen_list,false);


        window.show_all ();
        Gtk.main ();
    return 0;
}
_______________________________________________
vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to