gtk.CellLayout — an interface for packing cells
class gtk.CellLayout(gobject.GInterface): |
This 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.
|
cell : | 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.
|
cell : | 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.
|
This 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.
|
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.
|
cell : | 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.
|
cell : | 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:
|
where 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.
|
cell : | 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.
|
cell : | 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.