Class

GtkTreeViewColumn

Description [src]

class Gtk.TreeViewColumn : GObject.InitiallyUnowned
  implements Gtk.Buildable, Gtk.CellLayout {
  priv: GtkTreeViewColumnPrivate*
}

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.

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

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.

since: 3.0

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. 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 GtkCellRendererText get its values from column 2.

gtk_tree_view_column_cell_get_position

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.

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.

since: 2.2

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.

since: 3.0

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.

since: 2.4

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

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.

since: 2.12

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. If a custom widget has not been set then NULL is returned.

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.

since: 3.2

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.

since: 2.8

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. The attributes should be in attribute/column order, as in gtk_tree_view_column_add_attribute(). All existing attributes are removed, and replaced with the new attributes.

gtk_tree_view_column_set_cell_data_func

Sets the GtkTreeCellDataFunc 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_columns cell renderer as appropriate. func may be NULL to remove an older one.

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.

since: 2.4

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

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

Please see GObject for a full list of methods.

Methods inherited from GtkBuildable (10)
gtk_buildable_add_child

Adds a child to buildable. type is an optional string describing how the child should be added.

since: 2.12

gtk_buildable_construct_child

Constructs a child of buildable with the name name.

since: 2.12

gtk_buildable_custom_finished

This is similar to gtk_buildable_parser_finished() but is called once for each custom tag handled by the buildable.

since: 2.12

gtk_buildable_custom_tag_end

This is called at the end of each custom element handled by the buildable.

since: 2.12

gtk_buildable_custom_tag_start

This is called for each unknown element under <child>.

since: 2.12

gtk_buildable_get_internal_child

Get the internal child called childname of the buildable object.

since: 2.12

gtk_buildable_get_name

Gets the name of the buildable object.

since: 2.12

gtk_buildable_parser_finished

Called when the builder finishes the parsing of a [GtkBuilder UI definition][BUILDER-UI]. Note that this will be called once for each time gtk_builder_add_from_file() or gtk_builder_add_from_string() is called on a builder.

since: 2.12

gtk_buildable_set_buildable_property

Sets the property name name to value on the buildable object.

since: 2.12

gtk_buildable_set_name

Sets the name of the buildable object.

since: 2.12

Methods inherited from GtkCellLayout (10)
gtk_cell_layout_add_attribute

Adds an attribute mapping to the list in cell_layout.

since: 2.4

gtk_cell_layout_clear

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

since: 2.4

gtk_cell_layout_clear_attributes

Clears all existing attributes previously set with gtk_cell_layout_set_attributes().

since: 2.4

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.

since: 3.0

gtk_cell_layout_get_cells

Returns the cell renderers which have been added to cell_layout.

since: 2.12

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.

since: 2.4

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.

since: 2.4

gtk_cell_layout_reorder

Re-inserts cell at position.

since: 2.4

gtk_cell_layout_set_attributes

Sets the attributes in list as the attributes of cell_layout.

since: 2.4

gtk_cell_layout_set_cell_data_func

Sets the GtkCellLayoutDataFunc to use for cell_layout.

since: 2.4

Properties

Gtk.TreeViewColumn:alignment
No description available.

Gtk.TreeViewColumn:cell-area

The GtkCellArea used to layout cell renderers for this column.

since: 3.0

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.

since: 2.18

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
No description available.

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct GtkTreeViewColumnClass {
  GInitiallyUnownedClass parent_class;
  void (* clicked) (
    GtkTreeViewColumn* tree_column
  );
  void (* _gtk_reserved1) (
void
  );
  void (* _gtk_reserved2) (
void
  );
  void (* _gtk_reserved3) (
void
  );
  void (* _gtk_reserved4) (
void
  );
  
}

No description available.

Class members
parent_class: GInitiallyUnownedClass

No description available.

clicked: void (* clicked) ( GtkTreeViewColumn* tree_column )

No description available.

_gtk_reserved1: void (* _gtk_reserved1) ( void )

No description available.

_gtk_reserved2: void (* _gtk_reserved2) ( void )

No description available.

_gtk_reserved3: void (* _gtk_reserved3) ( void )

No description available.

_gtk_reserved4: void (* _gtk_reserved4) ( void )

No description available.

Virtual methods

Gtk.TreeViewColumnClass.clicked

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