def __add_columns(self): column = gtk.TreeViewColumn(_('Categories')) renderer = gtk.CellRendererText() renderer.set_property('ellipsize', pango.ELLIPSIZE_END) renderer.set_property('mode', gtk.CELL_RENDERER_MODE_ACTIVATABLE) column.pack_start(renderer, True) column.set_sort_column_id(self.COLUMN_NAME) column.set_attributes(renderer, markup=self.COLUMN_DESC) column.set_resizable(True) self.append_column(column) renderer = CellRendererButton() renderer.connect("clicked", self.on_action_clicked) column.pack_end(renderer, False) column.set_attributes(renderer, text=self.COLUMN_ACTION)
def __add_columns(self, treeview): model = treeview.get_model() column = gtk.TreeViewColumn(_("ID")) renderer = gtk.CellRendererPixbuf() column.pack_start(renderer, False) column.set_attributes(renderer, pixbuf=COLUMN_LOGO) renderer = gtk.CellRendererText() column.pack_start(renderer, True) column.set_attributes(renderer, text=COLUMN_TITLE) treeview.append_column(column) column = gtk.TreeViewColumn(_("Command")) renderer = gtk.CellRendererPixbuf() column.pack_start(renderer, False) column.set_attributes(renderer, pixbuf=COLUMN_ICON) renderer = gtk.CellRendererText() renderer.connect("edited", self.on_cell_edited, model) column.pack_start(renderer, True) column.set_attributes(renderer, text=COLUMN_COMMAND, editable=COLUMN_EDITABLE) treeview.append_column(column) column = gtk.TreeViewColumn(_("Key")) renderer = gtk.CellRendererText() renderer.connect("editing-started", self.on_editing_started) renderer.connect("edited", self.on_cell_edited, model) column.pack_start(renderer, True) column.set_attributes(renderer, text=COLUMN_KEY, editable=COLUMN_EDITABLE) column.set_resizable(True) treeview.append_column(column) renderer = CellRendererButton(_("Clean")) renderer.connect("clicked", self.on_clean_clicked) column.pack_end(renderer, False)
def __add_columns(self, treeview): model = treeview.get_model() column = gtk.TreeViewColumn(_("ID")) renderer = gtk.CellRendererPixbuf() column.pack_start(renderer, False) column.set_attributes(renderer, pixbuf = COLUMN_LOGO) renderer = gtk.CellRendererText() column.pack_start(renderer, True) column.set_attributes(renderer, text = COLUMN_TITLE) treeview.append_column(column) column = gtk.TreeViewColumn(_("Command")) renderer = gtk.CellRendererPixbuf() column.pack_start(renderer, False) column.set_attributes(renderer, pixbuf = COLUMN_ICON) renderer = gtk.CellRendererText() renderer.connect("edited", self.on_cell_edited, model) column.pack_start(renderer, True) column.set_attributes(renderer, text = COLUMN_COMMAND, editable = COLUMN_EDITABLE) treeview.append_column(column) column = gtk.TreeViewColumn(_("Key")) renderer = gtk.CellRendererText() renderer.connect("editing-started", self.on_editing_started) renderer.connect("edited", self.on_cell_edited, model) column.pack_start(renderer, True) column.set_attributes(renderer, text=COLUMN_KEY, editable=COLUMN_EDITABLE) column.set_resizable(True) treeview.append_column(column) renderer = CellRendererButton(_("Clean")) renderer.connect("clicked", self.on_clean_clicked) column.pack_end(renderer, False)