# Class k.u.o.Column(PropertyObject, gobject.GObject):

Part of kiwi.ui.objectlist View In Hierarchy

Known subclasses: kiwi.ui.objectlist.ColoredColumn, kiwi.ui.objectlist.SequentialColumn

Specifies a column for an `ObjectList`, see the ObjectList documentation for a simple example.

# Properties

- title: string mandatory
  - the title of the column, defaulting to the capitalized form of the attribute
- data-type: object str
  - the type of the attribute that will be inserted into the column. Supported data types: bool, int, float, str, unicode, decimal.Decimal, datetime.date, datetime.time, datetime.datetime, gtk.gdk.Pixbuf, `kiwi.currency.currency`, `kiwi.python.enum`.
- visible: bool True
  - specifying if it is initially hidden or shown.
- justify: gtk.Justification None
  - one of gtk.JUSTIFY_LEFT, gtk.JUSTIFY_RIGHT or gtk.JUSTIFY_CENTER or None. If None, the justification will be determined by the type of the attribute value of the first instance to be inserted in the ObjectList (for instance numbers will be right-aligned).
- format: string ""
  - a format string to be applied to the attribute value upon insertion in the list.
- width: integer 65535
  - the width in pixels of the column, if not set, uses the default to ObjectList. If no Column specifies a width, columns_autosize() will be called on the ObjectList upon append() or the first add_list().
- sorted: bool False
  - whether or not the ObjectList is to be sorted by this column. If no Columns are sorted, the ObjectList will be created unsorted.
- order: GtkSortType -1
  - one of gtk.SORT_ASCENDING, gtk.SORT_DESCENDING or -1 The value -1 is mean that the column is not sorted.
- expand: bool False
  - if set column will expand. Note: this space is shared equally amongst all columns that have the expand set to True.
- tooltip: string ""
  - a string which will be used as a tooltip for the column header
- format_func: object None
  - a callable which will be used to format the output of a column. The function will take one argument which is the value to convert and is expected to return a string. Note: that you cannot use format and format_func at the same time, if you provide a format function you'll be responsible for converting the value to a string.
- editable: bool False
  - if true the field is editable and when you modify the contents of the cell the model will be updated.
- searchable: bool False
  - if true the attribute values of the column can be searched using type ahead search. Only string attributes are currently supported.
- radio: bool False
  - If true render the column as a radio instead of toggle. Only applicable for columns with boolean data types.
- spin_adjustment: gtk.Adjustment None
  - A gtk.Adjustment instance. If set, render the column cell as a spinbutton.
- use_stock: bool False
  - If true, this will be rendered as pixbuf from the value which should be a stock id.
- icon_size: gtk.IconSize gtk.ICON_SIZE_MENU
- editable_attribute: string ""
  - a string which is the attribute which should decide if the cell is editable or not.
- use_markup: bool False
  - If true, the text will be rendered with markup
- expander: bool False
  - If True, this column will be used as the tree expander column
- ellipsize: pango.EllipsizeMode pango.ELLIPSIZE_NONE
  - One of pango.ELLIPSIZE_{NONE, START, MIDDLE_END}, it describes where characters should be removed in case ellipsization (where to put the ...) is needed.
- font-desc: str ""
  - A string passed to pango.FontDescription, for instance "Sans" or
- column: str None
  - A string referencing to another column. If this is set a new column will not be created and the column will be packed into the other.

Method | __init__ | Creates a new Column, which describes how a column in a
Method | __repr__ | Undocumented
Method | prop_set_data_type | Undocumented
Method | attach | Undocumented
Method | _guess_renderer_for_type | Gusses which CellRenderer we should use for a given type.
Method | _cell_data_text_func | To render the data of a cell renderer text
Method | _cell_data_pixbuf_func | To render the data of a cell renderer pixbuf
Method | _cell_data_combo_func | Undocumented
Method | _cell_data_spin_func | To render the data of a cell renderer spin
Method | _on_renderer__toggled | Undocumented
Method | _on_renderer_toggle_check__toggled | Undocumented
Method | _on_renderer_toggle_radio__toggled | Undocumented
Method | _on_renderer_text__edited | Undocumented
Method | _on_renderer_spin__edited | Undocumented
Method | _on_renderer_combo__edited | Undocumented
Method | _on_renderer__edited | Undocumented
Method | as_string | Undocumented
Method | set_spinbutton_precision_digits | Set the number of precision digits to be shown in the

Inherited from PropertyObject:

Class Method | __class_init__ | Undocumented
Method | __post_init__ | A hook which is called after the constructor is called.
Method | _set | Undocumented
Method | _get | Undocumented
Method | get_attribute_names | Undocumented
Method | is_default_value | Undocumented
Method | do_set_property | Undocumented
Method | do_get_property | Undocumented

def __init__(self, attribute='', title=None, data_type=None, **kwargs):
overrides kiwi.utils.PropertyObject.__init__
overridden in kiwi.ui.objectlist.ColoredColumn, kiwi.ui.objectlist.SequentialColumn
Creates a new Column, which describes how a column in a ObjectList should be rendered.

Parameters | attribute | a string with the name of the instance attribute the column represents.
| title | the title of the column, defaulting to the capitalized form of the attribute.
| data_type | the type of the attribute that will be inserted into the column.
Note | title_pixmap: (TODO) if set to a filename a pixmap will be used *instead* of the title set. The title string will still be used to identify the column in the column selection and in a tooltip, if a tooltip is not set.

def __repr__(self):
Undocumented
def prop_set_data_type(self, data):
Undocumented
def attach(self, objectlist):
Undocumented
def _guess_renderer_for_type(self, model):
Gusses which CellRenderer we should use for a given type. It also set the property of the renderer that depends on the model, in the renderer.

def _cell_data_text_func(self, tree_column, renderer, model, treeiter, (column, renderer_prop)):
To render the data of a cell renderer text

def _cell_data_pixbuf_func(self, tree_column, renderer, model, treeiter, (column, renderer_prop)):
To render the data of a cell renderer pixbuf

def _cell_data_combo_func(self, tree_column, renderer, model, treeiter, (column, renderer_prop)):
Undocumented
def _cell_data_spin_func(self, tree_column, renderer, model, treeiter, (column, renderer_prop)):
To render the data of a cell renderer spin

def _on_renderer__toggled(self, renderer, path, column):
Undocumented
def _on_renderer_toggle_check__toggled(self, renderer, path, model, attr):
Undocumented
def _on_renderer_toggle_radio__toggled(self, renderer, path, model, attr):
Undocumented
def _on_renderer_text__edited(self, renderer, path, text, model, attr, column, from_string):
Undocumented
def _on_renderer_spin__edited(self, renderer, path, value, model, attr, column, from_string):
Undocumented
def _on_renderer_combo__edited(self, renderer, path, text, model, attr, column):
Undocumented
def _on_renderer__edited(self, renderer, path, value, column):
Undocumented
def as_string(self, data):
Undocumented
def set_spinbutton_precision_digits(self, digits):
Set the number of precision digits to be shown in the spinbutton.

Parameters | digits | the number of precision digits to be set in spinbutton (type: int )