GtkCellLayout: GtkCellLayout

Description Methods and Functions Hierarchy Implementations Detailed Description GtkCellLayouts as GtkBuildable Structures User Functions Author(s) References

Description

An interface for packing cells

Methods and Functions

gtkCellLayoutPackStart(object, cell, expand = TRUE)
gtkCellLayoutPackEnd(object, cell, expand = TRUE)
gtkCellLayoutGetCells(object)
gtkCellLayoutReorder(object, cell, position)
gtkCellLayoutClear(object)
gtkCellLayoutSetAttributes(object, cell, ...)
gtkCellLayoutAddAttribute(object, cell, attribute, column)
gtkCellLayoutSetCellDataFunc(object, cell, func, func.data = NULL)
gtkCellLayoutClearAttributes(object, cell)

Hierarchy

1
2
GInterface
   +----GtkCellLayout

Implementations

GtkCellLayout is implemented by GtkCellView, GtkComboBox, GtkComboBoxEntry, GtkEntryCompletion, GtkIconView and GtkTreeViewColumn.

Detailed Description

GtkCellLayout 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 gtkCellLayoutSetAttributes, which means that the value of the attribute can change from cell to cell as they are rendered by the cell renderer. Finally, it is possible to specify a function with gtkCellLayoutSetCellDataFunc that is called to determine the value of the attribute for each cell that is rendered.

GtkCellLayouts as GtkBuildable

Implementations 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.

A UI definition fragment specifying attributes

1
2
3
4
5
6
7
8
<object class="GtkCellView">
  <child>
    <object class="GtkCellRendererText"/>
    <attributes>
      <attribute name="text">0</attribute>
    </attributes>
  </child>"
</object>

Structures

GtkCellLayout

undocumented

User Functions

GtkCellLayoutDataFunc(cell.layout, cell, tree.model, iter, data)

A function which should set the value of cell.layout's cell renderer(s) as appropriate.

cell.layout

a GtkCellLayout

cell

the cell renderer whose value is to be set

tree.model

the model

iter

a GtkTreeIter indicating the row to set the value for

data

user data passed to gtkCellLayoutSetCellDataFunc

Author(s)

Derived by RGtkGen from GTK+ documentation

References

https://developer.gnome.org/gtk2/stable/GtkCellLayout.html


RGtk2 documentation built on Oct. 14, 2021, 5:08 p.m.

Related to GtkCellLayout in RGtk2...