gtkmm 4.19.0
|
An interface for packing cells. More...
#include <gtkmm/celllayout.h>
Public Types | |
typedef sigc::slot< void(const TreeModel::const_iterator &)> | SlotCellData |
Public Member Functions | |
CellLayout (CellLayout && src) noexcept | |
CellLayout & | operator= (CellLayout && src) noexcept |
~CellLayout () noexcept override | |
GtkCellLayout * | gobj () |
Provides access to the underlying C GObject. | |
const GtkCellLayout * | gobj () const |
Provides access to the underlying C GObject. | |
template<class ColumnType> | |
void | pack_start (const TreeModelColumn< ColumnType > & model_column, bool expand=true) |
void | pack_start (CellRenderer & cell, bool expand=true) |
Packs the cell into the beginning of cell_layout. | |
void | pack_end (CellRenderer & cell, bool expand=true) |
Adds the cell to the end of cell_layout. | |
std::vector< CellRenderer * > | get_cells () |
Returns the cell renderers which have been added to cell_layout. | |
std::vector< const CellRenderer * > | get_cells () const |
Returns the cell renderers which have been added to cell_layout. | |
CellRenderer * | get_first_cell () |
Gets the CellRenderer for the first column if any has been added, or nullptr otherwise. | |
const CellRenderer * | get_first_cell () const |
Gets the CellRenderer for the first column if any has been added, or nullptr otherwise. | |
void | clear () |
Unsets all the mappings on all renderers on cell_layout and removes all renderers from cell_layout. | |
void | add_attribute (CellRenderer & cell, const Glib::ustring & attribute, int column) |
Adds an attribute mapping to the list in cell_layout. | |
void | add_attribute (const Glib::PropertyProxy_Base & property, const TreeModelColumnBase & column) |
void | add_attribute (CellRenderer & cell, const Glib::ustring & attribute, const TreeModelColumnBase & column) |
void | set_cell_data_func (CellRenderer & cell, const SlotCellData & slot) |
void | clear_attributes (CellRenderer & cell) |
Clears all existing attributes previously set with set_attributes(). | |
void | reorder (CellRenderer & cell, int position) |
Re-inserts cell at position. | |
Glib::RefPtr< CellArea > | get_area () |
Returns the underlying Gtk::CellArea which might be cell_layout if called on a Gtk::CellArea or might be nullptr if no Gtk::CellArea is used by cell_layout. | |
Glib::RefPtr< const CellArea > | get_area () const |
Returns the underlying Gtk::CellArea which might be cell_layout if called on a Gtk::CellArea or might be nullptr if no Gtk::CellArea is used by cell_layout. | |
template<class T_ModelColumnType> | |
void | pack_start (const TreeModelColumn< T_ModelColumnType > & column, bool expand) |
Static Public Member Functions | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. |
Protected Member Functions | |
CellLayout () | |
You should derive from this class to use it. | |
virtual void | pack_start_vfunc (CellRenderer * cell, bool expand) |
virtual void | pack_end_vfunc (CellRenderer * cell, bool expand) |
virtual void | clear_vfunc () |
virtual void | add_attribute_vfunc (CellRenderer * cell, const Glib::ustring & attribute, int column) |
virtual void | clear_attributes_vfunc (CellRenderer * cell) |
virtual void | reorder_vfunc (CellRenderer * cell, int position) |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gtk::CellLayout > | wrap (GtkCellLayout * object, bool take_copy=false) |
A Glib::wrap() method for this object. |
An interface for packing cells.
CellLayout is an interface to be implemented by all objects which want to provide a TreeView::Column-like API for packing cells, setting attributes and data funcs.
typedef sigc::slot<void(const TreeModel::const_iterator&)> Gtk::CellLayout::SlotCellData |
|
protected |
You should derive from this class to use it.
|
noexcept |
|
overridenoexcept |
void Gtk::CellLayout::add_attribute | ( | CellRenderer & | cell, |
const Glib::ustring & | attribute, | ||
const TreeModelColumnBase & | column ) |
void Gtk::CellLayout::add_attribute | ( | CellRenderer & | cell, |
const Glib::ustring & | attribute, | ||
int | column ) |
Adds an attribute mapping to the list in cell_layout.
The column is the column of the model to get a value from, and the attribute is the property on cell to be set from that 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. In this context "attribute" and "property" are used interchangeably.
Deprecated: 4.10
cell | A Gtk::CellRenderer. |
attribute | A property on the renderer. |
column | The column position on the model to get the attribute from. |
void Gtk::CellLayout::add_attribute | ( | const Glib::PropertyProxy_Base & | property, |
const TreeModelColumnBase & | column ) |
|
protectedvirtual |
|
static |
void Gtk::CellLayout::clear | ( | ) |
Unsets all the mappings on all renderers on cell_layout and removes all renderers from cell_layout.
Deprecated: 4.10
void Gtk::CellLayout::clear_attributes | ( | CellRenderer & | cell | ) |
Clears all existing attributes previously set with set_attributes().
Deprecated: 4.10
cell | A Gtk::CellRenderer to clear the attribute mapping on. |
|
protectedvirtual |
|
protectedvirtual |
Glib::RefPtr< CellArea > Gtk::CellLayout::get_area | ( | ) |
Returns the underlying Gtk::CellArea which might be cell_layout if called on a Gtk::CellArea or might be nullptr if no Gtk::CellArea is used by cell_layout.
Deprecated: 4.10
Glib::RefPtr< const CellArea > Gtk::CellLayout::get_area | ( | ) | const |
Returns the underlying Gtk::CellArea which might be cell_layout if called on a Gtk::CellArea or might be nullptr if no Gtk::CellArea is used by cell_layout.
Deprecated: 4.10
std::vector< CellRenderer * > Gtk::CellLayout::get_cells | ( | ) |
Returns the cell renderers which have been added to cell_layout.
Deprecated: 4.10
std::vector< const CellRenderer * > Gtk::CellLayout::get_cells | ( | ) | const |
Returns the cell renderers which have been added to cell_layout.
Deprecated: 4.10
CellRenderer * Gtk::CellLayout::get_first_cell | ( | ) |
Gets the CellRenderer for the first column if any has been added, or nullptr otherwise.
You should dynamic_cast<> to the expected derived CellRenderer type.
const CellRenderer * Gtk::CellLayout::get_first_cell | ( | ) | const |
Gets the CellRenderer for the first column if any has been added, or nullptr otherwise.
You should dynamic_cast<> to the expected derived CellRenderer type.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
|
noexcept |
void Gtk::CellLayout::pack_end | ( | CellRenderer & | cell, |
bool | expand = true ) |
Adds the cell to the end of cell_layout.
If 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.
Note that reusing the same cell renderer is not supported.
Deprecated: 4.10
cell | A Gtk::CellRenderer. |
expand | true if cell is to be given extra space allocated to cell_layout. |
|
protectedvirtual |
void Gtk::CellLayout::pack_start | ( | CellRenderer & | cell, |
bool | expand = true ) |
Packs the cell into the beginning of cell_layout.
If 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.
Note that reusing the same cell renderer is not supported.
Deprecated: 4.10
cell | A Gtk::CellRenderer. |
expand | true if cell is to be given extra space allocated to cell_layout. |
|
inline |
void Gtk::CellLayout::pack_start | ( | const TreeModelColumn< T_ModelColumnType > & | column, |
bool | expand ) |
|
protectedvirtual |
void Gtk::CellLayout::reorder | ( | CellRenderer & | cell, |
int | position ) |
Re-inserts cell at position.
Note that cell has already to be packed into cell_layout for this to function properly.
Deprecated: 4.10
cell | A Gtk::CellRenderer to reorder. |
position | New position to insert cell at. |
|
protectedvirtual |
void Gtk::CellLayout::set_cell_data_func | ( | CellRenderer & | cell, |
const SlotCellData & | slot ) |
|
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |