import gtk

(COLUMN_NUMBER,
 COLUMN_SEVERITY,
 COLUMN_DESCRIPTION) = range(3)

win = gtk.Window()
win.connect('delete-event', gtk.main_quit)
win.set_default_size(300, 250)
model = gtk.ListStore(int, str, str)

treeview = gtk.TreeView(model)
treeview.set_rules_hint(True)
win.add(treeview)

# column for description
column = gtk.TreeViewColumn('Description', gtk.CellRendererText(),
                             text=COLUMN_DESCRIPTION)
column.set_expand(True)
treeview.append_column(column)

# columns for severities
column = gtk.TreeViewColumn('Severity', gtk.CellRendererText(),
                            text=COLUMN_SEVERITY)
treeview.append_column(column)
column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
column.set_fixed_width(50)
column.set_resizable(True)

# column for bug numbers
column = gtk.TreeViewColumn('Bug Number', gtk.CellRendererText(),
                            text=COLUMN_NUMBER)
treeview.append_column(column)

win.show_all()
gtk.main()
