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

import pygtk
pygtk.require('2.0')
import gtk

class MainUI:
    def __init__(self):
        # Comment the below line to have a normal window
        gtk.widget_set_default_direction(gtk.TEXT_DIR_RTL)
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.connect("destroy", lambda wid: gtk.main_quit())

        tvcolumn = [None] * 2
        cell = [None] * 2
        self.store = gtk.ListStore(int, str)
        file_list = gtk.TreeView(self.store)
        for i in range(5):
            self.store.append([i, str(i) + ".py"])
        for i in range(2):
            tvcolumn[i] = gtk.TreeViewColumn(str(i))
            cell[i] = gtk.CellRendererText()
            tvcolumn[i].pack_start(cell[i], True)
            tvcolumn[i].set_attributes(cell[i], text=i)
            file_list.append_column(tvcolumn[i])

        file_list.set_size_request(200, 200)
        file_list.show()

        self.window.add(file_list)
        self.window.show()


def main():
    MainUI()
    gtk.main()
    return 0 


if __name__ == "__main__":
    main()
