#!/usr/bin/python

from gi.repository import Gtk

class Value(object):

    def __init__(self, key, value):
        self.key = key
        self.value = value

class MyView(Gtk.TreeView):

    def __init__(self):
        Gtk.TreeView.__init__(self)

        self.model = Gtk.ListStore(int, str, object)

        col = Gtk.TreeViewColumn("Number")
        renderer = Gtk.CellRendererText()
        col.pack_start(renderer, True)
        col.add_attribute(renderer, "text", 0)
        self.append_column(col)

        self.set_model(self.model)

def quit(*args):
    Gtk.main_quit()

if __name__ == '__main__':
    win = Gtk.Window(title="Test")
    win.connect("delete-event", quit)
    win.connect("destroy-event", quit)

    view = MyView()
    win.add(view)

    model = view.get_model()
    for i in range(29):
        label = "The value is %d" % i
        model.append([i, label, Value(i, label)])

    win.show_all()
    Gtk.main()
