A visible column in a [classGtk.TreeView] widget
The GtkTreeViewColumn object represents a visible column in a GtkTreeView widget. It allows to set properties of the column header, and functions as a holding pen for the cell renderers which determine how the data in the column is displayed.
Please refer to the tree widget conceptual overview for an overview of all the objects and data types related to the tree widget and how they work together, and to the [classGtk.TreeView] documentation for specifics about the CSS node structure for treeviews and their headers.
function "+"
(Widget : access Gtk_Tree_View_Column_Record'Class)
return Gtk.Buildable.Gtk_Buildable
function "+"
(Widget : access Gtk_Tree_View_Column_Record'Class)
return Gtk.Cell_Layout.Gtk_Cell_Layout
function "-"
(Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Tree_View_Column
function "-"
(Interf : Gtk.Cell_Layout.Gtk_Cell_Layout)
return Gtk_Tree_View_Column
procedure Add_Attribute
(Self : not null access Gtk_Tree_View_Column_Record;
Cell : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Attribute : UTF8_String;
Column : Glib.Gint)
Alignment_Property : constant Glib.Properties.Property_Float;
type Cb_GObject_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class);
type Cb_Gtk_Tree_View_Column_Void is not null access procedure
(Self : access Gtk_Tree_View_Column_Record'Class);
Cell_Area_Property : constant Glib.Properties.Property_Object;
Type: Gtk.Cell_Area.Gtk_Cell_Area The GtkCellArea used to layout cell renderers for this column.
If no area is specified when creating the tree view column with Gtk.Tree_View_Column.Gtk_New_With_Area a horizontally oriented GtkCellAreaBox will be used.
procedure Cell_Get_Position
(Self : not null access Gtk_Tree_View_Column_Record;
Cell_Renderer : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
X_Offset : out Glib.Gint;
Width : out Glib.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. Deprecated since 4.10, 1
a GtkCellRenderer
return location for the horizontal position of Cell within Tree_Column
return location for the width of Cell
True if Cell belongs to Tree_Column
procedure Cell_Get_Size
(Self : not null access Gtk_Tree_View_Column_Record;
X_Offset : out Glib.Gint;
Y_Offset : out Glib.Gint;
Width : out Glib.Gint;
Height : out Glib.Gint)
Obtains the width and height needed to render the column. This is used primarily by the GtkTreeView. Deprecated since 4.10, 1
location to return x offset of a cell relative to Cell_Area
location to return y offset of a cell relative to Cell_Area
location to return width needed to render a cell
location to return height needed to render a cell
function Cell_Is_Visible
(Self : not null access Gtk_Tree_View_Column_Record) return Boolean
Returns True if any of the cells packed into the Tree_Column are visible. For this to be meaningful, you must first initialize the cells with Gtk.Tree_View_Column.Cell_Set_Cell_Data Deprecated since 4.10, 1
True, if any of the cells packed into the Tree_Column are currently visible
procedure Cell_Set_Cell_Data
(Self : not null access Gtk_Tree_View_Column_Record;
Tree_Model : Gtk.Tree_Model.Gtk_Tree_Model;
Iter : Gtk.Tree_Model.Gtk_Tree_Iter;
Is_Expander : Boolean;
Is_Expanded : Boolean)
Sets the cell renderer based on the Tree_Model and Iter. That is, for every attribute mapping in Tree_Column, it will get a value from the set column on the Iter, and use that value to set the attribute on the cell renderer. This is used primarily by the GtkTreeView. Deprecated since 4.10, 1
The GtkTreeModel to get the cell renderers attributes from.
The GtkTreeIter to get the cell renderer's attributes from.
True, if the row has children
True, if the row has visible children
procedure Clear (Self : not null access Gtk_Tree_View_Column_Record)
procedure Clear_Attributes
(Self : not null access Gtk_Tree_View_Column_Record;
Cell : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class)
Clickable_Property : constant Glib.Properties.Property_Boolean;
procedure Clicked (Self : not null access Gtk_Tree_View_Column_Record)
Emits the "clicked" signal on the column. This function will only work if Tree_Column is clickable. Deprecated since 4.10, 1
package Column_List is new Generic_List (Gtk.Tree_View_Column.Gtk_Tree_View_Column);
function Convert (R : Gtk.Tree_View_Column.Gtk_Tree_View_Column) return System.Address
function Convert (R : System.Address) return Gtk.Tree_View_Column.Gtk_Tree_View_Column
Expand_Property : constant Glib.Properties.Property_Boolean;
Fixed_Width_Property : constant Glib.Properties.Property_Int;
procedure Focus_Cell
(Self : not null access Gtk_Tree_View_Column_Record;
Cell : not null 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. Deprecated since 4.10, 1
A GtkCellRenderer
function Get_Alignment
(Self : not null access Gtk_Tree_View_Column_Record)
return Interfaces.C.C_float
Returns the current x alignment of Tree_Column. This value can range between 0.0 and 1.0. Deprecated since 4.10, 1
The current alignent of Tree_Column.
function Get_Button
(Self : not null access Gtk_Tree_View_Column_Record)
return Gtk.Widget.Gtk_Widget
Returns the button used in the treeview column header Deprecated since 4.10, 1
The button for the column header. Has transfer-ownership='none'.
function Get_Cells
(Self : not null access Gtk_Tree_View_Column_Record)
return Gtk.Cell_Renderer.Cell_Renderer_List.Glist
function Get_Clickable
(Self : not null access Gtk_Tree_View_Column_Record) return Boolean
Returns True if the user can click on the header for the column. Deprecated since 4.10, 1
True if user can click the column header.
function Get_Expand
(Self : not null access Gtk_Tree_View_Column_Record) return Boolean
Returns True if the column expands to fill available space. Deprecated since 4.10, 1
True if the column expands to fill available space.
function Get_Fixed_Width
(Self : not null access Gtk_Tree_View_Column_Record) return Glib.Gint
Gets the fixed width of the column. This may not be the actual displayed width of the column; for that, use Gtk.Tree_View_Column.Get_Width. Deprecated since 4.10, 1
The fixed width of the column.
function Get_Max_Width
(Self : not null access Gtk_Tree_View_Column_Record) return Glib.Gint
Returns the maximum width in pixels of the Tree_Column, or -1 if no maximum width is set. Deprecated since 4.10, 1
The maximum width of the Tree_Column.
function Get_Min_Width
(Self : not null access Gtk_Tree_View_Column_Record) return Glib.Gint
Returns the minimum width in pixels of the Tree_Column, or -1 if no minimum width is set. Deprecated since 4.10, 1
The minimum width of the Tree_Column.
function Get_Reorderable
(Self : not null access Gtk_Tree_View_Column_Record) return Boolean
Returns True if the Tree_Column can be reordered by the user. Deprecated since 4.10, 1
True if the Tree_Column can be reordered by the user.
function Get_Resizable
(Self : not null access Gtk_Tree_View_Column_Record) return Boolean
Returns True if the Tree_Column can be resized by the end user. Deprecated since 4.10, 1
True, if the Tree_Column can be resized.
function Get_Sizing
(Self : not null access Gtk_Tree_View_Column_Record)
return Gtk_Tree_View_Column_Sizing
Returns the current type of Tree_Column. Deprecated since 4.10, 1
The type of Tree_Column.
function Get_Sort_Column_Id
(Self : not null access Gtk_Tree_View_Column_Record) return Glib.Gint
Gets the logical Sort_Column_Id that the model sorts on when this column is selected for sorting. See [methodGtk.TreeViewColumn.set_sort_column_id]. Deprecated since 4.10, 1
the current Sort_Column_Id for this column, or -1 if this column can't be used for sorting
function Get_Sort_Indicator
(Self : not null access Gtk_Tree_View_Column_Record) return Boolean
Gets the value set by Gtk.Tree_View_Column.Set_Sort_Indicator. Deprecated since 4.10, 1
whether the sort indicator arrow is displayed
function Get_Sort_Order
(Self : not null access Gtk_Tree_View_Column_Record)
return Gtk.Enums.Gtk_Sort_Type
Gets the value set by Gtk.Tree_View_Column.Set_Sort_Order. Deprecated since 4.10, 1
the sort order the sort indicator is indicating
function Get_Spacing
(Self : not null access Gtk_Tree_View_Column_Record) return Glib.Gint
Returns the spacing of Tree_Column. Deprecated since 4.10, 1
the spacing of Tree_Column.
function Get_Title
(Self : not null access Gtk_Tree_View_Column_Record)
return UTF8_String
Returns the title of the widget. Deprecated since 4.10, 1
the title of the column. This string should not be modified or freed.
function Get_Tree_View
(Self : not null access Gtk_Tree_View_Column_Record)
return Gtk.Widget.Gtk_Widget
Returns the GtkTreeView wherein Tree_Column has been inserted. If Column is currently not inserted in any tree view, null is returned. Deprecated since 4.10, 1
The tree view wherein Column has been inserted. Has transfer-ownership='none'.
function Get_Type return Glib.GType
function Get_Visible
(Self : not null access Gtk_Tree_View_Column_Record) return Boolean
Returns True if Tree_Column is visible. Deprecated since 4.10, 1
whether the column is visible or not. If it is visible, then the tree will show the column.
function Get_Widget
(Self : not null access Gtk_Tree_View_Column_Record)
return Gtk.Widget.Gtk_Widget
Returns the GtkWidget in the button on the column header. If a custom widget has not been set then null is returned. Deprecated since 4.10, 1
The GtkWidget in the column header. Has transfer-ownership='none'.
function Get_Width
(Self : not null access Gtk_Tree_View_Column_Record) return Glib.Gint
Returns the current size of Tree_Column in pixels. Deprecated since 4.10, 1
The current width of Tree_Column.
function Get_X_Offset
(Self : not null access Gtk_Tree_View_Column_Record) return Glib.Gint
Returns the current X offset of Tree_Column in pixels. Deprecated since 4.10, 1
The current X offset of Tree_Column.
type Gtk_Cell_Layout_Data_Func is access procedure
(Cell_Layout : Gtk.Cell_Layout.Gtk_Cell_Layout;
Cell : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Tree_Model : Gtk.Tree_Model.Gtk_Tree_Model;
Iter : Gtk.Tree_Model.Gtk_Tree_Iter);
A function which should set the value of Cell_Layout's cell renderer(s) as appropriate.
a GtkCellLayout
the cell renderer whose value is to be set
the model
a GtkTreeIter indicating the row to set the value for
procedure Gtk_New (Self : out Gtk_Tree_View_Column)
Creates a new GtkTreeViewColumn. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
procedure Gtk_New_With_Area
(Self : out Gtk_Tree_View_Column;
Area : not null access Gtk.Cell_Area.Gtk_Cell_Area_Record'Class)
Creates a new GtkTreeViewColumn using Area to render its cells. Initialize_With_Area does nothing if the object was already created with another call to Initialize* or G_New.
the GtkCellArea that the newly created column should use to layout cells.
type Gtk_Tree_View_Column is access all Gtk_Tree_View_Column_Record'Class;
function Gtk_Tree_View_Column_New return Gtk_Tree_View_Column
Creates a new GtkTreeViewColumn.
function Gtk_Tree_View_Column_New_With_Area
(Area : not null access Gtk.Cell_Area.Gtk_Cell_Area_Record'Class)
return Gtk_Tree_View_Column
Creates a new GtkTreeViewColumn using Area to render its cells.
the GtkCellArea that the newly created column should use to layout cells.
type Gtk_Tree_View_Column_Record is new GObject_Record with null record;
type Gtk_Tree_View_Column_Sizing is (
Grow_Only,
Autosize,
Fixed);
The sizing method the column uses to determine its width. Please note that Gtk.Tree_View_Column.Autosize are inefficient for large views, and can make columns appear choppy.
package Gtk_Tree_View_Column_Sizing_Properties is
new Generic_Internal_Discrete_Property (Gtk_Tree_View_Column_Sizing);
package Implements_Gtk_Buildable is new Glib.Types.Implements
(Gtk.Buildable.Gtk_Buildable, Gtk_Tree_View_Column_Record, Gtk_Tree_View_Column);
package Implements_Gtk_Cell_Layout is new Glib.Types.Implements
(Gtk.Cell_Layout.Gtk_Cell_Layout, Gtk_Tree_View_Column_Record, Gtk_Tree_View_Column);
procedure Initialize
(Self : not null access Gtk_Tree_View_Column_Record'Class)
Creates a new GtkTreeViewColumn. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
procedure Initialize_With_Area
(Self : not null access Gtk_Tree_View_Column_Record'Class;
Area : not null access Gtk.Cell_Area.Gtk_Cell_Area_Record'Class)
Creates a new GtkTreeViewColumn using Area to render its cells. Initialize_With_Area does nothing if the object was already created with another call to Initialize* or G_New.
the GtkCellArea that the newly created column should use to layout cells.
Max_Width_Property : constant Glib.Properties.Property_Int;
Min_Width_Property : constant Glib.Properties.Property_Int;
procedure On_Clicked
(Self : not null access Gtk_Tree_View_Column_Record;
Call : Cb_GObject_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
Emitted when the column's header has been clicked.
procedure On_Clicked
(Self : not null access Gtk_Tree_View_Column_Record;
Call : Cb_Gtk_Tree_View_Column_Void;
After : Boolean := False)
Emitted when the column's header has been clicked.
procedure Pack_End
(Self : not null access Gtk_Tree_View_Column_Record;
Cell : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Expand : Boolean)
procedure Pack_Start
(Self : not null access Gtk_Tree_View_Column_Record;
Cell : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Expand : Boolean)
type Property_Gtk_Tree_View_Column_Sizing is new Gtk_Tree_View_Column_Sizing_Properties.Property;
procedure Queue_Resize
(Self : not null access Gtk_Tree_View_Column_Record)
Flags the column, and the cell renderers added to this column, to have their sizes renegotiated. Deprecated since 4.10, 1
procedure Reorder
(Self : not null access Gtk_Tree_View_Column_Record;
Cell : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Position : Glib.Gint)
Reorderable_Property : constant Glib.Properties.Property_Boolean;
Resizable_Property : constant Glib.Properties.Property_Boolean;
procedure Set_Alignment
(Self : not null access Gtk_Tree_View_Column_Record;
Xalign : Interfaces.C.C_float)
Sets 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. Deprecated since 4.10, 1
The alignment, which is between [0.0 and 1.0] inclusive.
procedure Set_Cell_Data_Func
(Self : not null access Gtk_Tree_View_Column_Record;
Cell : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Func : Gtk_Cell_Layout_Data_Func)
Sets the GtkCellLayoutDataFunc 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 a previously set function. Deprecated since 4.10, 1
a GtkCellRenderer
the GtkCellLayoutDataFunc to use
procedure Set_Clickable
(Self : not null access Gtk_Tree_View_Column_Record;
Clickable : Boolean)
Sets the header to be active if Clickable is True. When the header is active, then it can take keyboard focus, and can be clicked. Deprecated since 4.10, 1
True if the header is active.
procedure Set_Expand
(Self : not null access Gtk_Tree_View_Column_Record;
Expand : 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. Along with "fixed-width", the "expand" property changes when the column is resized by the user. Deprecated since 4.10, 1
True if the column should expand to fill available space.
procedure Set_Fixed_Width
(Self : not null access Gtk_Tree_View_Column_Record;
Fixed_Width : Glib.Gint)
If Fixed_Width is not -1, sets the fixed width of Tree_Column; otherwise unsets it. The effective value of Fixed_Width is clamped between the minimum and maximum width of the column; however, the value stored in the "fixed-width" property is not clamped. If the column sizing is Gtk.Tree_View_Column.Grow_Only or Gtk.Tree_View_Column.Autosize, setting a fixed width overrides the automatically calculated width. Note that Fixed_Width is only a hint to GTK; the width actually allocated to the column may be greater or less than requested. Along with "expand", the "fixed-width" property changes when the column is resized by the user. Deprecated since 4.10, 1
The new fixed width, in pixels, or -1.
procedure Set_Max_Width
(Self : not null access Gtk_Tree_View_Column_Record;
Max_Width : Glib.Gint)
Sets 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 any extra space. Deprecated since 4.10, 1
The maximum width of the column in pixels, or -1.
procedure Set_Min_Width
(Self : not null access Gtk_Tree_View_Column_Record;
Min_Width : Glib.Gint)
Sets the minimum width of the Tree_Column. If Min_Width is -1, then the minimum width is unset. Deprecated since 4.10, 1
The minimum width of the column in pixels, or -1.
procedure Set_Reorderable
(Self : not null access Gtk_Tree_View_Column_Record;
Reorderable : Boolean)
If Reorderable is True, then the column can be reordered by the end user dragging the header. Deprecated since 4.10, 1
True, if the column can be reordered.
procedure Set_Resizable
(Self : not null access Gtk_Tree_View_Column_Record;
Resizable : Boolean)
If Resizable is True, then the user can explicitly resize the column by grabbing the outer edge of the column button. If resizable is True and sizing mode of the column is Gtk.Tree_View_Column.Autosize, then the sizing mode is changed to Gtk.Tree_View_Column.Grow_Only. Deprecated since 4.10, 1
True, if the column can be resized
procedure Set_Sizing
(Self : not null access Gtk_Tree_View_Column_Record;
The_Type : Gtk_Tree_View_Column_Sizing)
Sets the growth behavior of Tree_Column to Type. Deprecated since 4.10, 1
The GtkTreeViewColumnSizing.
procedure Set_Sort_Column_Id
(Self : not null access Gtk_Tree_View_Column_Record;
Sort_Column_Id : Glib.Gint)
Sets the logical Sort_Column_Id that this column sorts on when this column is selected for sorting. Doing so makes the column header clickable. Deprecated since 4.10, 1
The Sort_Column_Id of the model to sort on.
procedure Set_Sort_Indicator
(Self : not null access Gtk_Tree_View_Column_Record;
Setting : Boolean)
Call this function with a Setting of True to display an arrow in the header button indicating the column is sorted. Call Gtk.Tree_View_Column.Set_Sort_Order to change the direction of the arrow. Deprecated since 4.10, 1
True to display an indicator that the column is sorted
procedure Set_Sort_Order
(Self : not null access Gtk_Tree_View_Column_Record;
Order : Gtk.Enums.Gtk_Sort_Type)
Changes 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_Id 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 Gtk.Tree_View_Column.Set_Sort_Indicator. Deprecated since 4.10, 1
sort order that the sort indicator should indicate
procedure Set_Spacing
(Self : not null access Gtk_Tree_View_Column_Record;
Spacing : Glib.Gint)
Sets the spacing field of Tree_Column, which is the number of pixels to place between cell renderers packed into it. Deprecated since 4.10, 1
distance between cell renderers in pixels.
procedure Set_Title
(Self : not null access Gtk_Tree_View_Column_Record;
Title : UTF8_String)
Sets the title of the Tree_Column. If a custom widget has been set, then this value is ignored. Deprecated since 4.10, 1
The title of the Tree_Column.
procedure Set_Visible
(Self : not null access Gtk_Tree_View_Column_Record;
Visible : Boolean)
Sets the visibility of Tree_Column. Deprecated since 4.10, 1
True if the Tree_Column is visible.
procedure Set_Widget
(Self : not null access Gtk_Tree_View_Column_Record;
Widget : access Gtk.Widget.Gtk_Widget_Record'Class)
Sets the widget in the header to be Widget. If widget is null, then the header button is set with a GtkLabel set to the title of Tree_Column. Deprecated since 4.10, 1
A child GtkWidget
Signal_Clicked : constant Glib.Signal_Name := "clicked";
Emitted when the column's header has been clicked.
Sizing_Property : constant Gtk.Tree_View_Column.Property_Gtk_Tree_View_Column_Sizing;
Type: Gtk_Tree_View_Column_Sizing
Sort_Column_Id_Property : constant Glib.Properties.Property_Int;
Logical sort column ID this column sorts on when selected for sorting. Setting the sort column ID makes the column header clickable. Set to -1 to make the column unsortable.
Sort_Indicator_Property : constant Glib.Properties.Property_Boolean;
Sort_Order_Property : constant Gtk.Enums.Property_Gtk_Sort_Type;
Spacing_Property : constant Glib.Properties.Property_Int;
Title_Property : constant Glib.Properties.Property_String;
Visible_Property : constant Glib.Properties.Property_Boolean;
Widget_Property : constant Glib.Properties.Property_Object;
Type: Gtk.Widget.Gtk_Widget
Width_Property : constant Glib.Properties.Property_Int;
X_Offset_Property : constant Glib.Properties.Property_Int;