Class

GtkTreeViewColumn

Description [src]

final class Gtk.TreeViewColumn : GObject.InitiallyUnowned {
  /* No available fields */
}

A visible column in a GtkTreeView 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][TreeWidget] for an overview of all the objects and data types related to the tree widget and how they work together, and to the GtkTreeView documentation for specifics about the CSS node structure for treeviews and their headers.

Hierarchy

hierarchy this GtkTreeViewColumn implements_0 GtkBuildable this--implements_0 implements_1 GtkCellLayout this--implements_1 ancestor_0 GInitiallyUnowned ancestor_0--this ancestor_1 GObject ancestor_1--ancestor_0

Ancestors

  • GInitiallyUnowned
  • GObject

Constructors

gtk_tree_view_column_new

Creates a new GtkTreeViewColumn.

gtk_tree_view_column_new_with_area

Creates a new GtkTreeViewColumn using area to render its cells.

gtk_tree_view_column_new_with_attributes

Creates a new GtkTreeViewColumn with a number of default values. This is equivalent to calling gtk_tree_view_column_set_title(), gtk_tree_view_column_pack_start(), and gtk_tree_view_column_set_attributes() on the newly created GtkTreeViewColumn.

Instance methods

gtk_tree_view_column_add_attribute

Adds an attribute mapping to the list in tree_column.

gtk_tree_view_column_cell_get_position

Obtains the horizontal position and size of a cell in a column.

gtk_tree_view_column_cell_get_size

Obtains the width and height needed to render the column. This is used primarily by the GtkTreeView.

gtk_tree_view_column_cell_is_visible

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()

gtk_tree_view_column_cell_set_cell_data

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.

gtk_tree_view_column_clear

Unsets all the mappings on all renderers on the tree_column.

gtk_tree_view_column_clear_attributes

Clears all existing attributes previously set with gtk_tree_view_column_set_attributes().

gtk_tree_view_column_clicked

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

gtk_tree_view_column_focus_cell

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

gtk_tree_view_column_get_alignment

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

gtk_tree_view_column_get_button

Returns the button used in the treeview column header.

gtk_tree_view_column_get_clickable

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

gtk_tree_view_column_get_expand

Returns TRUE if the column expands to fill available space.

gtk_tree_view_column_get_fixed_width

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().

gtk_tree_view_column_get_max_width

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

gtk_tree_view_column_get_min_width

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

gtk_tree_view_column_get_reorderable

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

gtk_tree_view_column_get_resizable

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

gtk_tree_view_column_get_sizing

Returns the current type of tree_column.

gtk_tree_view_column_get_sort_column_id

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

gtk_tree_view_column_get_sort_indicator

Gets the value set by gtk_tree_view_column_set_sort_indicator().

gtk_tree_view_column_get_sort_order

Gets the value set by gtk_tree_view_column_set_sort_order().

gtk_tree_view_column_get_spacing

Returns the spacing of tree_column.

gtk_tree_view_column_get_title

Returns the title of the widget.

gtk_tree_view_column_get_tree_view

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

gtk_tree_view_column_get_visible

Returns TRUE if tree_column is visible.

gtk_tree_view_column_get_widget

Returns the GtkWidget in the button on the column header.

gtk_tree_view_column_get_width

Returns the current size of tree_column in pixels.

gtk_tree_view_column_get_x_offset

Returns the current X offset of tree_column in pixels.

gtk_tree_view_column_pack_end

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.

gtk_tree_view_column_pack_start

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.

gtk_tree_view_column_queue_resize

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

gtk_tree_view_column_set_alignment

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.

gtk_tree_view_column_set_attributes

Sets the attributes in the list as the attributes of tree_column.

gtk_tree_view_column_set_cell_data_func

Sets the GtkTreeCellDataFunc to use for the column.

gtk_tree_view_column_set_clickable

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.

gtk_tree_view_column_set_expand

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.

gtk_tree_view_column_set_fixed_width

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.

gtk_tree_view_column_set_max_width

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.

gtk_tree_view_column_set_min_width

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

gtk_tree_view_column_set_reorderable

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

gtk_tree_view_column_set_resizable

If resizable is TRUE, then the user can explicitly resize the column by grabbing the outer edge of the column button.

gtk_tree_view_column_set_sizing

Sets the growth behavior of tree_column to type.

gtk_tree_view_column_set_sort_column_id

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.

gtk_tree_view_column_set_sort_indicator

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.

gtk_tree_view_column_set_sort_order

Changes the appearance of the sort indicator.

gtk_tree_view_column_set_spacing

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

gtk_tree_view_column_set_title

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

gtk_tree_view_column_set_visible

Sets the visibility of tree_column.

gtk_tree_view_column_set_widget

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.

Methods inherited from GtkBuildable (1)
gtk_buildable_get_buildable_id

Gets the ID of the buildable object.

Methods inherited from GtkCellLayout (10)
gtk_cell_layout_add_attribute

Adds an attribute mapping to the list in cell_layout.

gtk_cell_layout_clear

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

gtk_cell_layout_clear_attributes

Clears all existing attributes previously set with gtk_cell_layout_set_attributes().

gtk_cell_layout_get_area

Returns the underlying GtkCellArea which might be cell_layout if called on a GtkCellArea or might be NULL if no GtkCellArea is used by cell_layout.

gtk_cell_layout_get_cells

Returns the cell renderers which have been added to cell_layout.

gtk_cell_layout_pack_end

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.

gtk_cell_layout_pack_start

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.

gtk_cell_layout_reorder

Re-inserts cell at position.

gtk_cell_layout_set_attributes

Sets the attributes in the parameter list as the attributes of cell_layout.

gtk_cell_layout_set_cell_data_func

Sets the GtkCellLayoutDataFunc to use for cell_layout.

Properties

Gtk.TreeViewColumn:alignment
No description available.
Gtk.TreeViewColumn:cell-area

The GtkCellArea used to layout cell renderers for this column.

Gtk.TreeViewColumn:clickable
No description available.
Gtk.TreeViewColumn:expand
No description available.
Gtk.TreeViewColumn:fixed-width
No description available.
Gtk.TreeViewColumn:max-width
No description available.
Gtk.TreeViewColumn:min-width
No description available.
Gtk.TreeViewColumn:reorderable
No description available.
Gtk.TreeViewColumn:resizable
No description available.
Gtk.TreeViewColumn:sizing
No description available.
Gtk.TreeViewColumn:sort-column-id

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.

Gtk.TreeViewColumn:sort-indicator
No description available.
Gtk.TreeViewColumn:sort-order
No description available.
Gtk.TreeViewColumn:spacing
No description available.
Gtk.TreeViewColumn:title
No description available.
Gtk.TreeViewColumn:visible
No description available.
Gtk.TreeViewColumn:widget
No description available.
Gtk.TreeViewColumn:width
No description available.
Gtk.TreeViewColumn:x-offset
No description available.

Signals

Gtk.TreeViewColumn::clicked

Emitted when the column’s header has been clicked.