#! /usr/bin/python

from gi.repository import GObject, Gtk

def row_activated(view, path, *args):
    model = view.get_model()
    iterator = model.get_iter(path)
    print model.get_value(iterator, 0)

window = Gtk.Window()
view = Gtk.TreeView()
model = Gtk.ListStore.new([GObject.TYPE_STRING])
model.append(["Test cell 1"])
model.append(["Test cell 2"])
column = Gtk.TreeViewColumn(None, Gtk.CellRendererText(), text=0)
view.append_column(column)
view.set_model(model)
iterator = model.iter_nth_child(None, 1)
path = model.get_path(iterator)
view.get_selection().select_path(path)
view.connect("row-activated", row_activated)
window.add(view)
window.show_all()
Gtk.main()
