1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
self.tree_store = gtk.TreeStore(
str, # name
str, # sort name if available
str, # dates
str, # foreground color
str, # background color
int, # weight
gobject
)
self.tree_view = gtk.TreeView(self.tree_store)
self.tree_view.set_enable_tree_lines(True)
column1 = gtk.TreeViewColumn("Folders",
gtk.CellRendererText(),
text=0,
foreground=3,
background=4,
weight=5)
column1.set_reorderable(True)
column1.set_sort_column_id(1)
self.tree_view.append_column(column1)
column2 = gtk.TreeViewColumn("Dates",
gtk.CellRendererText(),
text=2,
foreground=3,
weight=5)
column2.set_reorderable(True)
column2.set_sort_column_id(2)
self.tree_view.append_column(column2)
self.tree_store.set_sort_column_id(2, gtk.SORT_ASCENDING)
self.scrolled_window = gtk.ScrolledWindow()
self.scrolled_window.add(self.tree_view)
self.tree_view.connect('row-activated', self.row_activated_callback) |
Partager