def _get_renderer(self, field, edit_mode): """Initialize and return a new cell renderer for `field`.""" font = gaupol.util.get_font() if field == gaupol.fields.NUMBER: renderer = gaupol.IntegerCellRenderer() renderer.props.editable = False renderer.props.xalign = 1 elif field.is_position: if edit_mode == aeidon.modes.TIME: if field == gaupol.fields.DURATION: renderer = gaupol.FloatCellRenderer() else: renderer = gaupol.TimeCellRenderer() elif edit_mode == aeidon.modes.FRAME: renderer = gaupol.IntegerCellRenderer() renderer.props.editable = True renderer.props.xalign = 1 elif field.is_text: renderer = gaupol.MultilineCellRenderer() renderer.props.editable = True renderer.props.xalign = 0 renderer.props.font = font renderer.props.yalign = 0 renderer.props.xpad = 4 renderer.props.ypad = 4 return renderer
def setup_method(self, method): self.renderer = gaupol.FloatCellRenderer()