def cell_icon(self, layout, cell, model, row): extent = model[row][1] if extent in (UNASSIGNED, None): cell.set_property('stock_id', gtk.STOCK_NO) cell.set_property('stock_size', gtk.ICON_SIZE_SMALL_TOOLBAR) cell.set_property('visible', False) else: pixbuf = icon.small_pixbuf(self, extent) cell.set_property('pixbuf', pixbuf) cell.set_property('visible', True)
def cell_icon(self, column, cell, model, row_iter): grid.Column.cell_icon(self, column, cell, model, row_iter) instance = model[row_iter][OBJECT_COLUMN] try: entity = getattr(instance, self.attribute) except EntityDoesNotExist: entity = UNASSIGNED if entity is UNASSIGNED: cell.set_property('stock_id', gtk.STOCK_NO) cell.set_property('stock_size', gtk.ICON_SIZE_SMALL_TOOLBAR) cell.set_property('visible', False) else: extent = entity.s.extent pixbuf = icon.small_pixbuf(self, extent) cell.set_property('pixbuf', pixbuf) cell.set_property('visible', True)
def cell_icon(self, column, cell, model, row_iter): extent = model[row_iter][OBJECT_COLUMN] pixbuf = icon.small_pixbuf(self, extent) cell.set_property('pixbuf', pixbuf)