W Wrapl, The Programming Language

Libraries:Gtk:Gtk:TreeViewColumn

Types

T

Inherits from:

The GtkTreeViewColumn object represents a visible column in a Gtk.Gtk.TreeView.T 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.



Constants

Nil : T

Functions

GetType() : Gtk.GObject.Type.T



New() : Gtk.Gtk.TreeViewColumn.T

Creates a new T.

Returns A newly created T.


NewWithAttributes(title @ Std.String.T, cell @ Gtk.Gtk.CellRenderer.T, ... @ Std.Object.T) : Gtk.Gtk.TreeViewColumn.T

Creates a new T with a number of default values. This is equivalent to calling SetTitle, PackStart, and SetAttributes on the newly created T.

Here's a simple example:

1
2
3
4
5
6
7
8
9
10
11
12
enum { TEXT_COLUMN, COLOR_COLUMN, N_COLUMNS };
...
{
  GtkTreeViewColumn *column;
  GtkCellRenderer   *renderer = gtk_cell_renderer_text_new ();

  column = gtk_tree_view_column_new_with_attributes ("Title",
                                                     renderer,
                                                     "text", TEXT_COLUMN,
                                                     "foreground", COLOR_COLUMN,
                                                     NULL);
}


Methods

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

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

tree_column A T.
cell_renderer the Gtk.Gtk.CellRenderer.T to set attributes on
attribute An attribute on the renderer
column The column position on the model to get the attribute from.


:CellGetPosition(self @ T, cell_renderer @ Gtk.Gtk.CellRenderer.T, start_pos @ Std.Object.T, width @ Std.Object.T) : Std.Symbol.T

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.

tree_column a T
cell_renderer a Gtk.Gtk.CellRenderer.T
start_pos return location for the horizontal position of cell within tree_column, may be NULL
width return location for the width of cell, may be NULL
Returns TRUE if cell belongs to tree_column.


:CellGetSize(self @ T, cell_area @ Gtk.Gdk.Rectangle.T, x_offset @ Std.Object.T, y_offset @ Std.Object.T, width @ Std.Object.T, height @ Std.Object.T) : Std.Object.T

Obtains the width and height needed to render the column. This is used primarily by the Gtk.Gtk.TreeView.T.

tree_column A T.
cell_area The area a cell in the column will be allocated, or NULL. [allow-none]
x_offset location to return x offset of a cell relative to cell_area, or NULL. [out][allow-none]
y_offset location to return y offset of a cell relative to cell_area, or NULL. [out][allow-none]
width location to return width needed to render a cell, or NULL. [out][allow-none]
height location to return height needed to render a cell, or NULL. [out][allow-none]


:CellIsVisible(self @ T) : Std.Symbol.T

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 CellSetCellData

tree_column A T
Returns TRUE, if any of the cells packed into the tree_column are currently visible


:CellSetCellData(self @ T, tree_model @ Gtk.Gtk.TreeModel.T, iter @ Gtk.Gtk.TreeIter.T, is_expander @ Std.Symbol.T, is_expanded @ Std.Symbol.T) : Std.Object.T

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 Gtk.Gtk.TreeView.T.

tree_column A T.
tree_model The Gtk.Gtk.TreeModel.T to to get the cell renderers attributes from.
iter The Gtk.Gtk.TreeIter.T to to get the cell renderer's attributes from.
is_expander TRUE, if the row has children
is_expanded TRUE, if the row has visible children


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

Unsets all the mappings on all renderers on the tree_column.

tree_column A T


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

Clears all existing attributes previously set with SetAttributes.

tree_column a T
cell_renderer a Gtk.Gtk.CellRenderer.T to clear the attribute mapping on.


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

Emits the "clicked" signal on the column. This function will only work if tree_column is clickable.

tree_column a T


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

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

tree_column A T
cell A Gtk.Gtk.CellRenderer.T


:GetAlignment(self @ T) : Std.Real.T

Returns the current x alignment of tree_column. This value can range between 0.0 and 1.0.

tree_column A T.
Returns The current alignent of tree_column.


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

Warning

GetCellRenderers has been deprecated since version 2.18 and should not be used in newly-written code. use Gtk.Gtk.CellLayout.GetCells instead.



:GetClickable(self @ T) : Std.Symbol.T

Returns TRUE if the user can click on the header for the column.

tree_column a T
Returns TRUE if user can click the column header.


:GetExpand(self @ T) : Std.Symbol.T

Return TRUE if the column expands to take any available space.

tree_column a T
Returns TRUE, if the column expands


:GetFixedWidth(self @ T) : Std.Integer.SmallT

Gets the fixed width of the column. This value is only meaning may not be the actual width of the column on the screen, just what is requested.

tree_column a T
Returns the fixed width of the column


:GetMaxWidth(self @ T) : Std.Integer.SmallT

Returns the maximum width in pixels of the tree_column, or -1 if no maximum width is set.

tree_column A T.
Returns The maximum width of the tree_column.


:GetMinWidth(self @ T) : Std.Integer.SmallT

Returns the minimum width in pixels of the tree_column, or -1 if no minimum width is set.

tree_column A T.
Returns The minimum width of the tree_column.


:GetReorderable(self @ T) : Std.Symbol.T

Returns TRUE if the tree_column can be reordered by the user.

tree_column A T
Returns TRUE if the tree_column can be reordered by the user.


:GetResizable(self @ T) : Std.Symbol.T

Returns TRUE if the tree_column can be resized by the end user.

tree_column A T
Returns TRUE, if the tree_column can be resized.


:GetSizing(self @ T) : Gtk.Gtk.TreeViewColumnSizing.T

Returns the current type of tree_column.

tree_column A T.
Returns The type of tree_column.


:GetSortColumnId(self @ T) : Std.Integer.SmallT

Gets the logical sort_column_id that the model sorts on when this column is selected for sorting. See SetSortColumnId.

tree_column a T
Returns the current sort_column_id for this column, or -1 if this column can't be used for sorting.


:GetSortIndicator(self @ T) : Std.Symbol.T

Gets the value set by SetSortIndicator.

tree_column a T
Returns whether the sort indicator arrow is displayed


:GetSortOrder(self @ T) : Gtk.Gtk.SortType.T

Gets the value set by SetSortOrder.

tree_column a T
Returns the sort order the sort indicator is indicating


:GetSpacing(self @ T) : Std.Integer.SmallT

Returns the spacing of tree_column.

tree_column A T.
Returns the spacing of tree_column.


:GetTitle(self @ T) : Std.String.T

Returns the title of the widget.

tree_column A T.
Returns the title of the column. This string should not be modified or freed.


:GetTreeView(self @ T) : Gtk.Gtk.Widget.T

Returns the Gtk.Gtk.TreeView.T wherein tree_column has been inserted. If column is currently not inserted in any tree view, NULL is returned.

tree_column A T
Returns The tree view wherein column has been inserted if any, NULL otherwise. [transfer none]


:GetVisible(self @ T) : Std.Symbol.T

Returns TRUE if tree_column is visible.

tree_column A T.
Returns whether the column is visible or not. If it is visible, then the tree will show the column.


:GetWidget(self @ T) : Gtk.Gtk.Widget.T

Returns the Gtk.Gtk.Widget.T in the button on the column header. If a custom widget has not been set then NULL is returned.

tree_column A T.
Returns The Gtk.Gtk.Widget.T in the column header, or NULL. [transfer none]


:GetWidth(self @ T) : Std.Integer.SmallT

Returns the current size of tree_column in pixels.

tree_column A T.
Returns The current width of tree_column.


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

Adds the cell to end of the column. 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.

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


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

Packs the cell into the beginning of the column. 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.

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


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

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

tree_column A T


:SetAlignment(self @ T, xalign @ Std.Real.T) : Std.Object.T

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.

tree_column A T.
xalign The alignment, which is between [0.0 and 1.0] inclusive.


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

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

tree_column A T.
cell_renderer the Gtk.Gtk.CellRenderer.T we're setting the attributes of


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

Sets the GtkTreeViewColumnFunc 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.

tree_column A T
cell_renderer A Gtk.Gtk.CellRenderer.T
func The GtkTreeViewColumnFunc to use.
func_data The user data for func.
destroy The destroy notification for func_data


:SetClickable(self @ T, clickable @ Std.Symbol.T) : Std.Object.T

Sets the header to be active if active is TRUE. When the header is active, then it can take keyboard focus, and can be clicked.

tree_column A T.
clickable TRUE if the header is active.


:SetExpand(self @ T, expand @ Std.Symbol.T) : Std.Object.T

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.

tree_column A T
expand TRUE if the column should take available extra space, FALSE if not


:SetFixedWidth(self @ T, fixed_width @ Std.Integer.SmallT) : Std.Object.T

Sets the size of the column in pixels. This is meaningful only if the sizing type is Gtk.Gtk.TreeViewColumnSizing.Fixed. The size of the column is clamped to the min/max width for the column. Please note that the min/max width of the column doesn't actually affect the "fixed_width" property of the widget, just the actual size when displayed.

tree_column A T.
fixed_width The size to set tree_column to. Must be greater than 0.


:SetMaxWidth(self @ T, max_width @ Std.Integer.SmallT) : Std.Object.T

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.

tree_column A T.
max_width The maximum width of the column in pixels, or -1.


:SetMinWidth(self @ T, min_width @ Std.Integer.SmallT) : Std.Object.T

Sets the minimum width of the tree_column. If min_width is -1, then the minimum width is unset.

tree_column A T.
min_width The minimum width of the column in pixels, or -1.


:SetReorderable(self @ T, reorderable @ Std.Symbol.T) : Std.Object.T

If reorderable is TRUE, then the column can be reordered by the end user dragging the header.

tree_column A T
reorderable TRUE, if the column can be reordered.


:SetResizable(self @ T, resizable @ Std.Symbol.T) : Std.Object.T

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.Gtk.TreeViewColumnSizing.Autosize, then the sizing mode is changed to Gtk.Gtk.TreeViewColumnSizing.GrowOnly.

tree_column A T
resizable TRUE, if the column can be resized


:SetSizing(self @ T, type @ Gtk.Gtk.TreeViewColumnSizing.T) : Std.Object.T

Sets the growth behavior of tree_column to type.

tree_column A T.
type The Gtk.Gtk.TreeViewColumnSizing.T.


:SetSortColumnId(self @ T, sort_column_id @ Std.Integer.SmallT) : Std.Object.T

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.

tree_column a T
sort_column_id The sort_column_id of the model to sort on.


:SetSortIndicator(self @ T, setting @ Std.Symbol.T) : Std.Object.T

Call this function with a setting of TRUE to display an arrow in the header button indicating the column is sorted. Call SetSortOrder to change the direction of the arrow.

tree_column a T
setting TRUE to display an indicator that the column is sorted


:SetSortOrder(self @ T, order @ Gtk.Gtk.SortType.T) : Std.Object.T

Changes the appearance of the sort indicator.

This does not actually sort the model. Use SetSortColumnId 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 SetSortIndicator.

tree_column a T
order sort order that the sort indicator should indicate


:SetSpacing(self @ T, spacing @ Std.Integer.SmallT) : Std.Object.T

Sets the spacing field of tree_column, which is the number of pixels to place between cell renderers packed into it.

tree_column A T.
spacing distance between cell renderers in pixels.


:SetTitle(self @ T, title @ Std.String.T) : Std.Object.T

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

tree_column A T.
title The title of the tree_column.


:SetVisible(self @ T, visible @ Std.Symbol.T) : Std.Object.T

Sets the visibility of tree_column.

tree_column A T.
visible TRUE if the tree_column is visible.


:SetWidget(self @ T, widget @ Gtk.Gtk.Widget.T) : Std.Object.T

Sets the widget in the header to be widget. If widget is NULL, then the header button is set with a Gtk.Gtk.Label.T set to the title of tree_column.

tree_column A T.
widget A child Gtk.Gtk.Widget.T, or NULL. [allow-none]