Index

Package: Cell_Layout

Description

package Gtk.Cell_Layout is

Gtk_Cell_Layout is an interface to be implemented by all objects which want to provide a Gtk_Tree_View_Column like API for packing cells, setting attributes and data funcs.

The rendering of the widget is done through various Gtk_Cell_Renderer, and by reading data from a Gtk_Tree_Model.

Binding from C File version 2.8.17

<testgtk>create_cell_view.adb</testgtk>

Packages

Cell_Data_Functions (generic)

Types

Gtk_Cell_Layout

type Gtk_Cell_Layout is new Glib.Types.GType_Interface;
An interface (similar to Java's interfaces) that can be implemented by tagged types derived from Glib.Object.GObject.

Cell_Data_Func

type Cell_Data_Func is access procedure
     (Cell_Layout : Gtk_Cell_Layout;
      Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
      Model       : access Gtk.Tree_Model.Gtk_Tree_Model_Record'Class;
      Iter        : Gtk.Tree_Model.Gtk_Tree_Iter);
This subprogram can be used to globally modify an attribute of the Cell renderer. It should set the attributes of Cell as appropriate for this tree iter.

Subprograms & Entries

Get_Type

function Get_Type return Glib.GType;
Returns the internal type used for a Gtk_Cell_Layout interface

Pack_Start

procedure Pack_Start 
(Cell_Layout: Gtk_Cell_Layout;
Cell: access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Expand: Boolean);

Pack_End

procedure Pack_End 
(Cell_Layout: Gtk_Cell_Layout;
Cell: access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Expand: Boolean);
Adds Cell to the beginning or 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.

Add_Attribute

procedure Add_Attribute 
(Cell_Layout: Gtk_Cell_Layout;
Cell: access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Attribute: String;
Column: Gint);
Adds an attribute mapping to the list in Cell_Layout. Column is the column of the model to get a value from, and Attribute is the parameter on Cell to be set from the value. So for example if column of the model contains strings, you could have the "text" attribute of Gtk_Cell_Renderer_Text get its values from column 2. To mark rows as insensitive, create a column containing booleans in your model, and add an attribute "sensitive" to your renderer that points to this column.

Clear

procedure Clear 
(Cell_Layout: Gtk_Cell_Layout);
Unsets all the mappings on all renderers on Cell_Layout and removes all renderers from Cell_Layout.

Clear_Attributes

procedure Clear_Attributes 
(Cell_Layout: Gtk_Cell_Layout;
Cell: access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class);
Clears all existing attributes previously set with Add_Attribute.

Reorder

procedure Reorder 
(Cell_Layout: Gtk_Cell_Layout;
Cell: access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Position: Gint);
Re-inserts Cell at Position. Note that Cell has already to be packed into Cell_layout for this to function properly.

Set_Cell_Data_Func

procedure Set_Cell_Data_Func 
(Cell_Layout: Gtk_Cell_Layout;
Cell: access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Func: Cell_Data_Func);
Sets the Cell_Data_Func 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. This allows you to compute the attributes dynamically from several columns of the model for instance