def __init__(self, index, ui):
self.tagview = TagsView.new_from_index(index)
self.ui = ui
self.current_tag = None
self.model = gtk.ListStore(str, int, str) # PAGE_COL, TAGS_COL
SingleClickTreeView.__init__(self, self.model)
cells = (('Page', self.PAGE_COL, True),
('N', self.TAGS_N_COL, False),
('Tags', self.TAGS_COL, True))
for name, col_id, expand in cells:
cell = gtk.CellRendererText()
cell.set_property('ellipsize', pango.ELLIPSIZE_END)
cell.set_property('cell-background', 'white')
col = gtk.TreeViewColumn(name, cell)
col.set_attributes(cell, text = col_id)
col.set_resizable(expand)
col.set_expand(expand)
col.set_sort_column_id(col_id)
self.append_column(col)
self.connect('row-activated', lambda treeview, path, column:
self.row_activated(path, column))
self.refill_model()
评论列表
文章目录