using Gtk;

public class Application : Gtk.Window {
        Gtk.TreeView view;
        
	public Application () {
		// Prepare Gtk.Window:
		this.title = "My Gtk.TreeView";
		this.window_position = Gtk.WindowPosition.CENTER;
		this.destroy.connect (Gtk.main_quit);
		this.set_default_size (350, 70);

		// The Model:
		Gtk.ListStore list_store = new Gtk.ListStore (2, typeof (string), typeof (int));
		Gtk.TreeIter iter;

		list_store.append (out iter);
		list_store.set (iter, 0, "Burgenland", 1, 13);
		list_store.append (out iter);
		list_store.set (iter, 0, "Carinthia", 1, 17);
		list_store.append (out iter);
		list_store.set (iter, 0, "Lower Austria", 1, 75);
		list_store.append (out iter);
		list_store.set (iter, 0, "Upper Austria", 1, 32);
		list_store.append (out iter);
		list_store.set (iter, 0, "Salzburg", 1, 10);
		list_store.append (out iter);
		list_store.set (iter, 0, "Styria", 1, 34);
		list_store.append (out iter);
		list_store.set (iter, 0, "Tyrol", 1, 11);
		list_store.append (out iter);
		list_store.set (iter, 0, "Vorarlberg", 1, 5);
		list_store.append (out iter);
		list_store.set (iter, 0, "Vienna", 1, 1);

		// The View:
		view = new Gtk.TreeView.with_model (list_store);
		this.add (view);

		Gtk.CellRendererText cell = new Gtk.CellRendererText ();
		
		TreeViewColumn states = new TreeViewColumn.with_attributes ("State", cell, "text", 0);
		TreeViewColumn cities = new TreeViewColumn.with_attributes ("Cities", cell, "text", 1);
		
		states.set_cell_data_func (cell, text_cell_layout);
		cities.set_cell_data_func (cell, text_cell_layout);
		
		view.append_column (states);
		view.append_column (cities);
	}

        private void text_cell_layout (CellLayout layout, CellRenderer cell, TreeModel _model, TreeIter _iter)
        {
            Gdk.RGBA light_txt_color = view.get_style_context().get_color (StateFlags.INSENSITIVE);
        }

	public static int main (string[] args) {
		Gtk.init (ref args);

		Application app = new Application ();
		app.show_all ();
		Gtk.main ();
		return 0;
	}
}
