Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
 def _add_text_column(self, index, title):
     """Add a multiline text column to the tree view."""
     renderer = gaupol.MultilineCellRenderer()
     renderer.set_show_lengths(True)
     renderer.props.editable = (index == 4)
     renderer.props.ellipsize = Pango.EllipsizeMode.END
     renderer.props.font = gaupol.util.get_font()
     renderer.props.yalign = 0
     renderer.props.xpad = 4
     renderer.props.ypad = 4
     column = Gtk.TreeViewColumn(title, renderer, text=index)
     column.set_resizable(True)
     column.props.expand = True
     self._tree_view.append_column(column)
Ejemplo n.º 3
0
 def setup_method(self, method):
     self.renderer = gaupol.MultilineCellRenderer()