W Wrapl, The Programming Language

Libraries:Gtk:Gtk:CellLayout

Types

T

T 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 SetAttributes, 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 SetCellDataFunc 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 (Gtk.Gtk.CellView.T, Gtk.Gtk.IconView.T, Gtk.Gtk.ComboBox.T, Gtk.Gtk.ComboBoxEntry.T, Gtk.Gtk.EntryCompletion.T, Gtk.Gtk.TreeViewColumn.T) 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 26. 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>




ParentT

Constants

InterfaceInfo : Std.Object.T

Nil : T

Functions

GetType() : Gtk.GObject.Type.T



Methods

:AddAttribute(self @ T, cell @ Gtk.Gtk.CellRenderer.T, attribute @ Std.String.T, column @ Std.Integer.SmallT) : Std.Object.T

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 parameter on 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.Gtk.CellRendererText.T get its values from column 2.

cell_layout A T.
cell A Gtk.Gtk.CellRenderer.T.
attribute An attribute on the renderer.
column The column position on the model to get the attribute from.


:AddAttribute(_ @ ParentT, _ @ Gtk.Gtk.CellRenderer.T, _ @ Std.String.T, _ @ Std.Integer.SmallT)

:Clear(self @ T) : Std.Object.T

Unsets all the mappings on all renderers on cell_layout and removes all renderers from cell_layout.

cell_layout A T.


:Clear(_ @ ParentT)

:ClearAttributes(self @ T, cell @ Gtk.Gtk.CellRenderer.T) : Std.Object.T

Clears all existing attributes previously set with SetAttributes.

cell_layout A T.
cell A Gtk.Gtk.CellRenderer.T to clear the attribute mapping on.


:ClearAttributes(_ @ ParentT, _ @ Gtk.Gtk.CellRenderer.T)

:GetCells(self @ T) : Std.Object.T

Returns the cell renderers which have been added to cell_layout.

cell_layout a T
Returns a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed. [element-type GtkCellRenderer][transfer container]


:GetCells(_ @ ParentT)

:PackEnd(self @ T, cell @ Gtk.Gtk.CellRenderer.T, expand @ Std.Symbol.T) : Std.Object.T

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.

cell_layout A T.
cell A Gtk.Gtk.CellRenderer.T.
expand TRUE if cell is to be given extra space allocated to cell_layout.


:PackEnd(_ @ ParentT, _ @ Gtk.Gtk.CellRenderer.T, _ @ Std.Symbol.T)

:PackStart(self @ T, cell @ Gtk.Gtk.CellRenderer.T, expand @ Std.Symbol.T) : Std.Object.T

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.

cell_layout A T.
cell A Gtk.Gtk.CellRenderer.T.
expand TRUE if cell is to be given extra space allocated to cell_layout.


:PackStart(_ @ ParentT, _ @ Gtk.Gtk.CellRenderer.T, _ @ Std.Symbol.T)

:Reorder(self @ T, cell @ Gtk.Gtk.CellRenderer.T, position @ Std.Integer.SmallT) : Std.Object.T

Re-inserts cell at position. Note that cell has already to be packed into cell_layout for this to function properly.

cell_layout A T.
cell A Gtk.Gtk.CellRenderer.T to reorder.
position New position to insert cell at.


:Reorder(_ @ ParentT, _ @ Gtk.Gtk.CellRenderer.T, _ @ Std.Integer.SmallT)

:SetAttributes(self @ T, cell @ Gtk.Gtk.CellRenderer.T, ... @ Std.Object.T) : Std.Object.T

Sets the attributes in list as the attributes of cell_layout. The attributes should be in attribute/column order, as in AddAttribute. All existing attributes are removed, and replaced with the new attributes.

cell_layout A T.
cell A Gtk.Gtk.CellRenderer.T.


:SetCellDataFunc(self @ T, cell @ Gtk.Gtk.CellRenderer.T, func @ Std.Function.T, func_data @ Std.Address.T, destroy @ Std.Function.T) : Std.Object.T

Sets the Gtk.Gtk.CellLayoutDataFunc to use for cell_layout. This function is used instead of the standard attributes mapping for setting the column value, and should set the value of cell_layout's cell renderer(s) as appropriate. func may be NULL to remove and older one.

cell_layout A T.
cell A Gtk.Gtk.CellRenderer.T.
func The Gtk.Gtk.CellLayoutDataFunc to use.
func_data The user data for func.
destroy The destroy notification for func_data.


:SetCellDataFunc(_ @ ParentT, _ @ Gtk.Gtk.CellRenderer.T, _ @ Std.Function.T, _ @ Std.Address.T, _ @ Std.Function.T)