#!/usr/bin/env python
# -*- coding: utf-8 -*-

from gi.repository import Gtk

VALUES = [4,5,1,43,6,3,1,5,6,21]

view = Gtk.TreeView()
model = Gtk.ListStore(int)
view.set_model(model)

it = model.append([VALUES[0]])
for i in range(1, 10):
	model.append([VALUES[i]])

view.get_selection().select_iter(it)

for i in range(0, 9):
	# model.iter_next(it)
	it = model.iter_next(it)
	print model.get_value(it, 0)

for i in range(9, 0, -1):
	model.iter_previous(it)
	print model.get_value(it, 0)

