gtk.CellLayout an interface for packing cells Synopsis gtk.CellLayout gobject.GInterface pack_start cell expandTrue pack_end cell expandTrue clear get_cells set_attributes cell ... add_attribute cell attribute column set_cell_data_func cell func func_data clear_attributes cell reorder cell position Description 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. Methods gtk.CellLayout.pack_start pack_start cell expandTrue 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. gtk.CellLayout.pack_end pack_end cell expandTrue 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. gtk.CellLayout.clear clear 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. gtk.CellLayout.get_cells get_cells Returns : 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_attributes set_attributes cell ... 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_attribute add_attribute cell attribute column 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. gtk.CellLayout.set_cell_data_func set_cell_data_func cell func func_data 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: celldatafunction celllayout cell model iter user_data celldatamethod self celllayout cell model iter user_data 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. gtk.CellLayout.clear_attributes clear_attributes cell 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. gtk.CellLayout.reorder reorder cell position 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.