Synopsis#include <gtk/gtk.h> GtkCellLayout; GtkCellLayoutIface; void (*GtkCellLayoutDataFunc) (GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data); void gtk_cell_layout_pack_start (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gboolean expand); void gtk_cell_layout_pack_end (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gboolean expand); GList* gtk_cell_layout_get_cells (GtkCellLayout *cell_layout); void gtk_cell_layout_reorder (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gint position); void gtk_cell_layout_clear (GtkCellLayout *cell_layout); void gtk_cell_layout_set_attributes (GtkCellLayout *cell_layout, GtkCellRenderer *cell, ...); void gtk_cell_layout_add_attribute (GtkCellLayout *cell_layout, GtkCellRenderer *cell, const gchar *attribute, gint column); void gtk_cell_layout_set_cell_data_func (GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkCellLayoutDataFunc func, gpointer func_data, GDestroyNotify destroy); void gtk_cell_layout_clear_attributes (GtkCellLayout *cell_layout, GtkCellRenderer *cell); Known ImplementationsGtkCellLayout is implemented by GtkTreeViewColumn, GtkIconView, GtkCellView, GtkEntryCompletion, GtkComboBox and GtkComboBoxEntry. DescriptionGtkCellLayout is an interface to be implemented by all objects which want to provide a GtkTreeViewColumn-like API for packing cells, setting attributes and data funcs.
One of the notable features provided by implementations of GtkCellLayout
are attributes. Attributes let you set the properties
in flexible ways. They can just be set to constant values like regular
properties. But they can also be mapped to a column of the underlying
tree model with GtkCellLayouts as GtkBuildableImplementations of GtkCellLayout which also implement the GtkBuildable interface (GtkCellView, GtkIconView, GtkComboBox, GtkComboBoxEntry, GtkEntryCompletion, GtkTreeViewColumn) accept GtkCellRenderer objects as <child> elements in UI definitions. They support a custom <attributes> element for their children, which can contain multiple <attribute> elements. Each <attribute> element has a name attribute which specifies a property of the cell renderer; the content of the element is the attribute value. Example 22. A UI definition fragment specifying attributes <object class="GtkCellView"> <child> <object class="GtkCellRendererText"/> <attributes> <attribute name="text">0</attribute> </attributes> </child>" </object> DetailsGtkCellLayoutIfacetypedef struct { GTypeInterface g_iface; /* Virtual Table */ void (* pack_start) (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gboolean expand); void (* pack_end) (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gboolean expand); void (* clear) (GtkCellLayout *cell_layout); void (* add_attribute) (GtkCellLayout *cell_layout, GtkCellRenderer *cell, const gchar *attribute, gint column); void (* set_cell_data_func) (GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkCellLayoutDataFunc func, gpointer func_data, GDestroyNotify destroy); void (* clear_attributes) (GtkCellLayout *cell_layout, GtkCellRenderer *cell); void (* reorder) (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gint position); GList* (* get_cells) (GtkCellLayout *cell_layout); } GtkCellLayoutIface;
GtkCellLayoutDataFunc ()void (*GtkCellLayoutDataFunc) (GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data);
A function which should set the value of
gtk_cell_layout_pack_start ()void gtk_cell_layout_pack_start (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gboolean expand);
Packs the Note that reusing the same cell renderer is not supported.
Since 2.4 gtk_cell_layout_pack_end ()void gtk_cell_layout_pack_end (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gboolean expand);
Adds the Note that reusing the same cell renderer is not supported.
Since 2.4 gtk_cell_layout_get_cells ()GList* gtk_cell_layout_get_cells (GtkCellLayout *cell_layout);
Returns the cell renderers which have been added to
Since 2.12 gtk_cell_layout_reorder ()void gtk_cell_layout_reorder (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gint position);
Re-inserts
Since 2.4 gtk_cell_layout_clear ()void gtk_cell_layout_clear (GtkCellLayout *cell_layout);
Unsets all the mappings on all renderers on
Since 2.4 gtk_cell_layout_set_attributes ()void gtk_cell_layout_set_attributes (GtkCellLayout *cell_layout, GtkCellRenderer *cell, ...);
Sets the attributes in list as the attributes of
Since 2.4 gtk_cell_layout_add_attribute ()void gtk_cell_layout_add_attribute (GtkCellLayout *cell_layout, GtkCellRenderer *cell, const gchar *attribute, gint column);
Adds an attribute mapping to the list in
Since 2.4 gtk_cell_layout_set_cell_data_func ()void gtk_cell_layout_set_cell_data_func (GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkCellLayoutDataFunc func, gpointer func_data, GDestroyNotify destroy);
Sets the GtkCellLayoutDataFunc to use for
Since 2.4 gtk_cell_layout_clear_attributes ()void gtk_cell_layout_clear_attributes (GtkCellLayout *cell_layout, GtkCellRenderer *cell);
Clears all existing attributes previously set with
Since 2.4 |