## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

## Index

Package: Tree_View_Column

- Goto spec source

# Description

    package Gtk.Tree_View_Column is

General organization of the tree_view widgets:

______________Tree_View___________________________________ | _________________________ ________________________| | |_____Tree_View_Column1__| |___Tree_View_Column2 __|| | | | | || | | ----------- ---------|| | || | | |Renderer1| |render2 || | || | | | | | || | || | | | | | || | || | | | | | || | || | | |---------| |--------|| | || | |________________________| |_______________________|| |_________________________________________________________|
A tree view can contain multiple physical columns on the screen. These columns can have a button at the top, typically to force an ordering of the tree). They can also be reorganized interactively by the user.

Each physical column can display several information, like buttons, strings, ... Each of this display comes from a cell_renderer, that displays some data it reads from the model associated with the tree_view.

The renderers are then divided into lines, which are typically pointed to by iterators (Gtk_Tree_Iter).

Binding from C File version 2.8.17

# Packages

### Column_List (new Glib.Glist.Generic_List)

    package Column_List is new Glib.Glist.Generic_List (Gtk_Tree_View_Column);

### Cell_Data_Functions (generic)

Full description

### Column_Sizing_Properties (new Glib.Generic_Properties.Generic_Internal_Discrete_Property)

    package Column_Sizing_Properties is new
         Glib.Generic_Properties.Generic_Internal_Discrete_Property
           (Gtk_Tree_View_Column_Sizing);

# Classes

### Gtk_Tree_View_Column_Record

- Goto declaration in source
- Goto full declaration in source

    type Gtk_Tree_View_Column_Record is
         new Glib.Object.GObject_Record with private;

#### Ancestors:

Glib.Object.GObject_Record

#### Primitive operations:

Add_Attribute

- To API doc
- To spec

Cell_Get_Position

- To API doc
- To spec

Cell_Get_Size

- To API doc
- To spec

Cell_Is_Visible

- To API doc
- To spec

Cell_Set_Cell_Data

- To API doc
- To spec

Clear

- To API doc
- To spec

Clear_Attributes

- To API doc
- To spec

Clicked

- To API doc
- To spec

Focus_Cell

- To API doc
- To spec

Get_Alignment

- To API doc
- To spec

Get_Cell_Renderers

- To API doc
- To spec

Get_Clickable

- To API doc
- To spec

Get_Expand

- To API doc
- To spec

Get_Fixed_Width

- To API doc
- To spec

Get_Max_Width

- To API doc
- To spec

Get_Min_Width

- To API doc
- To spec

Get_Reorderable

- To API doc
- To spec

Get_Resizable

- To API doc
- To spec

Get_Sizing

- To API doc
- To spec

Get_Sort_Column_Id

- To API doc
- To spec

Get_Sort_Indicator

- To API doc
- To spec

Get_Sort_Order

- To API doc
- To spec

Get_Spacing

- To API doc
- To spec

Get_Title

- To API doc
- To spec

Get_Visible

- To API doc
- To spec

Get_Widget

- To API doc
- To spec

Get_Width

- To API doc
- To spec

Glib.Object.Deallocate

- To API doc
- To spec

(Inherited)
Glib.Object.Get_Type

- To API doc
- To spec

(Inherited)
Glib.Object.Notify

- To API doc
- To spec

(Inherited)
Glib.Object.Ref

- To API doc
- To spec

(Inherited)
Glib.Object.Ref_Sink

- To API doc
- To spec

(Inherited)
Glib.Object.Unref

- To API doc
- To spec

(Inherited)
Pack_End

- To API doc
- To spec

Pack_Start

- To API doc
- To spec

Queue_Resize

- To API doc
- To spec

Set_Alignment

- To API doc
- To spec

Set_Cell_Data_Func

- To API doc
- To spec

Set_Clickable

- To API doc
- To spec

Set_Expand

- To API doc
- To spec

Set_Fixed_Width

- To API doc
- To spec

Set_Max_Width

- To API doc
- To spec

Set_Min_Width

- To API doc
- To spec

Set_Reorderable

- To API doc
- To spec

Set_Resizable

- To API doc
- To spec

Set_Sizing

- To API doc
- To spec

Set_Sort_Column_Id

- To API doc
- To spec

Set_Sort_Indicator

- To API doc
- To spec

Set_Sort_Order

- To API doc
- To spec

Set_Spacing

- To API doc
- To spec

Set_Title

- To API doc
- To spec

Set_Visible

- To API doc
- To spec

Set_Widget

- To API doc
- To spec

# Types

### Gtk_Tree_View_Column

- Goto declaration in source

    type Gtk_Tree_View_Column is access all Gtk_Tree_View_Column_Record'Class;

### Gtk_Tree_View_Column_Sizing

- Goto declaration in source

    type Gtk_Tree_View_Column_Sizing is
         (Tree_View_Column_Grow_Only,
          Tree_View_Column_Autosize,
          Tree_View_Column_Fixed);

### Cell_Data_Func

- Goto declaration in source

    type Cell_Data_Func is access procedure
         (Tree_Column : access Gtk_Tree_View_Column_Record'Class;
          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 is called every time some event happens in the tree (a line was clicked, the mouse moved into or out of a line,...). Iter and Tree_Column point to the location in the tree that received the event.

### Property_Column_Sizing

- Goto declaration in source

    type Property_Column_Sizing is new Column_Sizing_Properties.Property;

# Constants & Global variables

### Alignment_Property

- Goto declaration in source

(Glib.Properties.Property_Float)

    Alignment_Property      : constant Glib.Properties.Property_Float;

### Clickable_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Clickable_Property      : constant Glib.Properties.Property_Boolean;

### Expand_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Expand_Property         : constant Glib.Properties.Property_Boolean;

### Fixed_Width_Property

- Goto declaration in source

(Glib.Properties.Property_Int)

    Fixed_Width_Property    : constant Glib.Properties.Property_Int;

### Max_Width_Property

- Goto declaration in source

(Glib.Properties.Property_Int)

    Max_Width_Property      : constant Glib.Properties.Property_Int;

### Min_Width_Property

- Goto declaration in source

(Glib.Properties.Property_Int)

    Min_Width_Property      : constant Glib.Properties.Property_Int;

### Reorderable_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Reorderable_Property    : constant Glib.Properties.Property_Boolean;

### Resizable_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Resizable_Property      : constant Glib.Properties.Property_Boolean;

### Sizing_Property

- Goto declaration in source

(Property_Column_Sizing)

    Sizing_Property         : constant Property_Column_Sizing;

### Sort_Indicator_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Sort_Indicator_Property : constant Glib.Properties.Property_Boolean;

### Sort_Order_Property

- Goto declaration in source

(Gtk.Enums.Property_Sort_Type)

    Sort_Order_Property     : constant Gtk.Enums.Property_Sort_Type;

### Spacing_Property

- Goto declaration in source

(Glib.Properties.Property_Int)

    Spacing_Property        : constant Glib.Properties.Property_Int;

### Title_Property

- Goto declaration in source

(Glib.Properties.Property_String)

    Title_Property          : constant Glib.Properties.Property_String;

### Visible_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Visible_Property        : constant Glib.Properties.Property_Boolean;

### Widget_Property

- Goto declaration in source

(Glib.Properties.Property_Object)

    Widget_Property         : constant Glib.Properties.Property_Object;

### Width_Property

- Goto declaration in source

(Glib.Properties.Property_Int)

    Width_Property          : constant Glib.Properties.Property_Int;

### Signal_Clicked

- Goto declaration in source

(Glib.Signal_Name)

    Signal_Clicked : constant Glib.Signal_Name := "clicked";

# Subprograms & Entries

### Convert

- Goto spec in source

    function Convert is new Ada.Unchecked_Conversion (Gtk_Tree_View_Column, System.Address);

### Convert

- Goto spec in source

    function Convert is new Ada.Unchecked_Conversion (System.Address, Gtk_Tree_View_Column);

### Gtk_New

- Goto spec in source

    procedure Gtk_New (Widget: out Gtk_Tree_View_Column);

### Initialize

- Goto spec in source

    procedure Initialize (Widget: access Gtk_Tree_View_Column_Record'Class);

Creates or initializes a new Gtk_Tree_View_Column.

### Get_Type

- Goto spec in source
- Goto body in source

    function Get_Type return Glib.GType;

Return the internal value associated with this widget.

### Pack_Start

- Goto spec in source

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

Add a renderer to the Tree_Column. Multiple renderers can be put in a specific column, and each of them can be associated with different data from the model. This provides a very powerful way to display different data in the same column.

### Pack_End

- Goto spec in source

    procedure Pack_End (Tree_Column: access Gtk_Tree_View_Column_Record;Cell: access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;Expand: Boolean);

Same as the above. See the description of Pack_Start and Pack_End in Gtk.Box for the precise difference between the two

### Clear

- Goto spec in source

    procedure Clear (Tree_Column: access Gtk_Tree_View_Column_Record);

Remove all the renderers set in the column. The column will always be empty until you put some new renderers.

### Get_Cell_Renderers

- Goto spec in source

    function Get_Cell_Renderers (Tree_Column: access Gtk_Tree_View_Column_Record) return Gtk.Cell_Renderer.Cell_Renderer_List.Glist;

### Add_Attribute

- Goto spec in source

    procedure Add_Attribute (Tree_Column: access Gtk_Tree_View_Column_Record;Cell_Renderer: access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;Attribute: String;Column: Gint);

Add an attribute mapping to the list in Tree_Column. The Column is the column of the model to get a value from, and the Attribute is the parameter on Cell_Renderer 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_Cell_Renderer_Text get its values from column 2. For a list of properties available for each Cell_Renderer, please refer to the corresponding package specifications. See also the function Set_Cell_Data_Func for another way to query the data to display in the tree.

### Set_Cell_Data_Func

- Goto spec in source

    procedure Set_Cell_Data_Func (Tree_Column: access Gtk_Tree_View_Column_Record;Cell: access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;Func: Cell_Data_Func);

Set the function to use for the column. This function is used instead of the standard attributes mapping for setting the column value, and should set the value of Tree_Column's cell renderer as appropriate. Func may be null to remove an older one. It should be used when values from the model should be computed from application-specific data structures rather than stored in the model.

### Clear_Attributes

- Goto spec in source

    procedure Clear_Attributes (Tree_Column: access Gtk_Tree_View_Column_Record;Cell_Renderer: access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class);

Clear all existing attributes previously set with Gtk.Tree_View_Column.Set_Attributes.

### Set_Spacing

- Goto spec in source

    procedure Set_Spacing (Tree_Column: access Gtk_Tree_View_Column_Record;Spacing: Gint);

### Get_Spacing

- Goto spec in source

    function Get_Spacing (Tree_Column: access Gtk_Tree_View_Column_Record) return Gint;

Set the spacing field of Tree_Column. The spacing field is the number of pixels to place between cell renderers packed into it.

### Set_Visible

- Goto spec in source

    procedure Set_Visible (Tree_Column: access Gtk_Tree_View_Column_Record;Visible: Boolean);

### Get_Visible

- Goto spec in source

    function Get_Visible (Tree_Column: access Gtk_Tree_View_Column_Record) return Boolean;

Set the visibility of Tree_Column.

### Set_Resizable

- Goto spec in source

    procedure Set_Resizable (Tree_Column: access Gtk_Tree_View_Column_Record;Resizable: Boolean);

### Get_Resizable

- Goto spec in source

    function Get_Resizable (Tree_Column: access Gtk_Tree_View_Column_Record) return Boolean;

Set whether the Tree_Column is resizable.

### Set_Sizing

- Goto spec in source

    procedure Set_Sizing (Tree_Column: access Gtk_Tree_View_Column_Record;The_Type: Gtk_Tree_View_Column_Sizing);

### Get_Sizing

- Goto spec in source

    function Get_Sizing (Tree_Column: access Gtk_Tree_View_Column_Record) return Gtk_Tree_View_Column_Sizing;

Set the growth behavior of Tree_Column to The_Type.

### Get_Width

- Goto spec in source

    function Get_Width (Tree_Column: access Gtk_Tree_View_Column_Record) return Gint;

Return the current size of the Tree_Column in pixels.

### Queue_Resize

- Goto spec in source

    procedure Queue_Resize (Tree_Column: access Gtk_Tree_View_Column_Record);

Flags the column, and the cell renderers added to this column, to have their sizes renegotiated.

### Set_Fixed_Width

- Goto spec in source

    procedure Set_Fixed_Width (Tree_Column: access Gtk_Tree_View_Column_Record;Fixed_Width: Gint);

### Get_Fixed_Width

- Goto spec in source

    function Get_Fixed_Width (Tree_Column: access Gtk_Tree_View_Column_Record) return Gint;

Set the size of the column in pixels. This is meaningful only if the sizing type is Gtk_Tree_View_Column_Fixed. In this case, the value is discarded as the size of the column is based on the calculated width of the column. The width is clamped to the min/max width for the column. The value returned by Get_Fixed_width may not be the actual width of the column on the screen, just what is requested.

### Set_Min_Width

- Goto spec in source

    procedure Set_Min_Width (Tree_Column: access Gtk_Tree_View_Column_Record;Min_Width: Gint);

### Get_Min_Width

- Goto spec in source

    function Get_Min_Width (Tree_Column: access Gtk_Tree_View_Column_Record) return Gint;

Set the minimum width of the Tree_Column. If Min_Width is -1, then the minimum width is unset.

### Set_Max_Width

- Goto spec in source

    procedure Set_Max_Width (Tree_Column: access Gtk_Tree_View_Column_Record;Max_Width: Gint);

### Get_Max_Width

- Goto spec in source

    function Get_Max_Width (Tree_Column: access Gtk_Tree_View_Column_Record) return Gint;

Set the maximum width of the Tree_Column. If Max_Width is -1, then the maximum width is unset. Note, the column can actually be wider than max width if it's the last column in a view. In this case, the column expands to fill the view.

### Clicked

- Goto spec in source

    procedure Clicked (Tree_Column: access Gtk_Tree_View_Column_Record);

Emit the "clicked" signal on the column. This function will only work if the user could have conceivably clicked on the button.

### Set_Expand

- Goto spec in source

    procedure Set_Expand (Tree_Column: access Gtk_Tree_View_Column_Record;Expand: Boolean);

### Get_Expand

- Goto spec in source

    function Get_Expand (Tree_Column: access Gtk_Tree_View_Column_Record) return Boolean;

Sets the column to take available extra space. This space is shared equally amongst all columns that have the expand set to TRUE. If no column has this option set, then the last column gets all extra space. By default, every column is created with this FALSE.

### Set_Title

- Goto spec in source

    procedure Set_Title (Tree_Column: access Gtk_Tree_View_Column_Record;Title: UTF8_String);

### Get_Title

- Goto spec in source

    function Get_Title (Tree_Column: access Gtk_Tree_View_Column_Record) return UTF8_String;

Set the title of the Tree_Column. If a custom widget has been set, then this value is ignored.

### Set_Clickable

- Goto spec in source

    procedure Set_Clickable (Tree_Column: access Gtk_Tree_View_Column_Record;Clickable: Boolean);

### Get_Clickable

- Goto spec in source

    function Get_Clickable (Tree_Column: access Gtk_Tree_View_Column_Record) return Boolean;

Set the header to be active if Active is True. When the header is active, then it can take keyboard focus, and can be clicked.

### Set_Widget

- Goto spec in source

    procedure Set_Widget (Tree_Column: access Gtk_Tree_View_Column_Record;Widget: access Gtk.Widget.Gtk_Widget_Record'Class);

### Get_Widget

- Goto spec in source

    function Get_Widget (Tree_Column: access Gtk_Tree_View_Column_Record) return Gtk.Widget.Gtk_Widget;

Return the Gtk_Widget in the button in the column header. If a custom widget has not been set, then this will be a Gtk_Alignment with a Gtk_Label in it.

### Set_Alignment

- Goto spec in source

    procedure Set_Alignment (Tree_Column: access Gtk_Tree_View_Column_Record;Xalign: Gfloat);

### Get_Alignment

- Goto spec in source

    function Get_Alignment (Tree_Column: access Gtk_Tree_View_Column_Record) return Gfloat;

Set the alignment of the title or custom widget inside the column header The alignment determines its location inside the button 0.0 for left, 0.5 for center, 1.0 for right.

### Set_Reorderable

- Goto spec in source

    procedure Set_Reorderable (Tree_Column: access Gtk_Tree_View_Column_Record;Reorderable: Boolean);

### Get_Reorderable

- Goto spec in source

    function Get_Reorderable (Tree_Column: access Gtk_Tree_View_Column_Record) return Boolean;

Whether this column can be drag-and-dropped to some other place in the tree.

### Set_Sort_Column_Id

- Goto spec in source

    procedure Set_Sort_Column_Id (Tree_Column: access Gtk_Tree_View_Column_Record;Sort_Column_Id: Gint);

### Get_Sort_Column_Id

- Goto spec in source

    function Get_Sort_Column_Id (Tree_Column: access Gtk_Tree_View_Column_Record) return Gint;

Set the logical model columns that this column sorts on when this column is selected for sorting. Doing so makes the column header clickable. Get_Sort_Column_Id returns -1 if this column can't be used for sorting.

### Set_Sort_Indicator

- Goto spec in source

    procedure Set_Sort_Indicator (Tree_Column: access Gtk_Tree_View_Column_Record;Setting: Boolean);

### Get_Sort_Indicator

- Goto spec in source

    function Get_Sort_Indicator (Tree_Column: access Gtk_Tree_View_Column_Record) return Boolean;

Call this function with a Setting of True to display an arrow in the header button indicating the column is sorted. Call Set_Sort_Order to change the direction of the arrow.

### Set_Sort_Order

- Goto spec in source

    procedure Set_Sort_Order (Tree_Column: access Gtk_Tree_View_Column_Record;Order: Gtk_Sort_Type);

### Get_Sort_Order

- Goto spec in source

    function Get_Sort_Order (Tree_Column: access Gtk_Tree_View_Column_Record) return Gtk_Sort_Type;

Change the appearance of the sort indicator. This does *not* actually sort the model. Use Gtk.Tree_View_Column.Set_Sort_Column_Id if you want automatic sorting support. This function is primarily for custom sorting behavior, and should be used in conjunction with Gtk.Tree_Sortable.Set_Sort_Column to do that. For custom models, the mechanism will vary. The sort indicator changes direction to indicate normal sort or reverse sort. Note that you must have the sort indicator enabled to see anything when calling this function; see Set_Sort_Indicator.

### Cell_Set_Cell_Data

- Goto spec in source

    procedure Cell_Set_Cell_Data (Tree_Column: access Gtk_Tree_View_Column_Record;Tree_Model: access Gtk.Tree_Model.Gtk_Tree_Model_Record'Class;Iter: Gtk.Tree_Model.Gtk_Tree_Iter;Is_Expander: Boolean;Is_Expanded: Boolean);

Set the cell renderer based on the Tree_Model and Tree_Node. That is, for every attribute mapping in Tree_Column, it will get a value from the set column on the Tree_Node, and use that value to set the attribute on the cell renderer. This is used primarily by the Gtk_Tree_View.

### Cell_Get_Size

- Goto spec in source

    procedure Cell_Get_Size (Tree_Column: access Gtk_Tree_View_Column_Record;Cell_Area: Gdk.Rectangle.Gdk_Rectangle;X_Offset: out Gint;Y_Offset: out Gint;Width: out Gint;Height: out Gint);

Obtain the width and height needed to render the column. This is used primarily by the Gtk_Tree_View.

### Cell_Is_Visible

- Goto spec in source

    function Cell_Is_Visible (Tree_Column: access Gtk_Tree_View_Column_Record) return Boolean;

Returns true if any of the cells packed in the column is visible

### Cell_Get_Position

- Goto spec in source

    procedure Cell_Get_Position (Tree_Column: access Gtk_Tree_View_Column_Record;Cell_Renderer: access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;Start_Pos: out Gint;Width: out Gint;Success: out Boolean);

Obtains the horizontal position and size of a cell in a column. If the cell is not found in the column, start_pos and width are not changed and FALSE is returned.

### Focus_Cell

- Goto spec in source

    procedure Focus_Cell (Tree_Column: access Gtk_Tree_View_Column_Record;Cell: access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class);

Sets the current keyboard focus to be at Cell, if the column contains 2 or more editable and activatable cells.