gtk.CellLayoutan interface for packing cellsSynopsisgtk.CellLayoutgobject.GInterfacepack_startcellexpandTruepack_endcellexpandTrueclearget_cellsset_attributescell...add_attributecellattributecolumnset_cell_data_funccellfuncfunc_dataclear_attributescellreordercellpositionDescriptionThis interface is available in PyGTK 2.4 and above.gtk.CellLayout
is an interface to be implemented by all objects that want to provide a
gtk.TreeViewColumn-like
API for packing cells, setting attributes and data funcs. The gtk.CellLayout
interface is implemented by the gtk.ComboBoxEntry,
gtk.ComboBox,
gtk.EntryCompletion
and gtk.TreeViewColumn
widgets.Methodsgtk.CellLayout.pack_startpack_startcellexpandTruecell :A gtk.CellRenderer.expand :if True, the
cell is to be given extra space that is
allocated to the cell layout.This method is available in PyGTK 2.4 and above.The pack_start() method packs the gtk.CellRenderer
specified by cell into the beginning of the cell
layout. If the optional parameter expand is
False, then cell is allocated no
more space than it needs. Any unused space is divided evenly between cells
for which expand is True.gtk.CellLayout.pack_endpack_endcellexpandTruecell :A gtk.CellRenderer.expand :if True, the
cell is to be given extra space that is
allocated to the cell layout.This method is available in PyGTK 2.4 and above.The pack_end() method adds the gtk.CellRenderer
specified by cell to the end of the cell layout. If
the optional parameter expand is
False, then the cell is allocated
no more space than it needs. Any unused space is divided evenly between
cells for which expand is
True.gtk.CellLayout.clearclearThis method is available in PyGTK 2.4 and above.The clear() method unsets all the
attribute mappings on all cell renderers in the cell layout.gtk.CellLayout.get_cellsget_cellsReturns :A list of cell renderers.This method is available in PyGTK 2.12 and above.The get_cells() method returns the cell
renderers which have been added to cell_layout.gtk.CellLayout.set_attributesset_attributescell...cell :A gtk.CellRenderer.... :Zero or more keyword-value arguments in the format
attribute=column.This method is available in PyGTK 2.4 and above.The set_attributes() method sets the
attributes provided as a keyword argument list as the attributes of the
gtk.CellRenderer
specified by cell. The attributes should be supplied
as keyword-value arguments in the format: attribute=column (e.g. text=0,
background=1). All existing attributes are removed, and replaced with the
new attributes.gtk.CellLayout.add_attributeadd_attributecellattributecolumncell :A gtk.CellRenderer.attribute :An attribute on the renderer.column :The column number in the model to get the attribute from.This method is available in PyGTK 2.4 and above.The add_attribute() method adds an
attribute mapping to the list in the cell layout. The
column parameter is the column of the model to get a
value from, and the attribute parameter is the
attribute of cell to be set from the value. So for
example if column 2 of the model contains strings, you could have the "text"
attribute of a gtk.CellRendererText
get its values from column 2.gtk.CellLayout.set_cell_data_funcset_cell_data_funccellfuncfunc_datacell :A gtk.CellRenderer.func :The function to use.func_data :The user data for func.This method is available in PyGTK 2.4 and above.The set_cell_data_func() method sets
the function (or method) specified by func to be used
for setting the column value of the gtk.CellRenderer
specified by cell instead of using the standard
attribute mapping method. func may be
None to remove the current function. The signature of
func is:celldatafunctioncelllayoutcellmodeliteruser_datacelldatamethodselfcelllayoutcellmodeliteruser_datawhere celllayout is the gtk.CellLayout,
cell is the gtk.CellRenderer
for celllayout, model is the
gtk.TreeModel and
iter is the gtk.TreeIter
pointing at the row.gtk.CellLayout.clear_attributesclear_attributescellcell :A gtk.CellRenderer to clear the attribute mapping on.This method is available in PyGTK 2.4 and above.The clear_attributes() method clears
all existing attribute mappings from the gtk.CellRenderer
specified by cell previously set with the set_attributes()
or add_attribute()
methods.gtk.CellLayout.reorderreordercellpositioncell :A gtk.CellRenderer to reorder.position :New position to insert cell at.This method is available in PyGTK 2.4 and above.The reorder() method re-inserts the
gtk.CellRenderer
specified by cell at
position. Note that cell has
to already be packed into cell_layout for this to
function properly.