TreeViewColumn

open class TreeViewColumn(pointer: <Error class: unknown class><<Error class: unknown class>>) : Buildable, CellLayout

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

Skipped during bindings generation

  • parameter x_offset: x_offset: Out parameter is not supported

  • parameter x_offset: x_offset: Out parameter is not supported

  • method cell-area: Property has no getter nor setter

Constructors

Link copied to clipboard
constructor()

Creates a new GtkTreeViewColumn.

constructor(area: CellArea)

Creates a new GtkTreeViewColumn using @area to render its cells.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open var alignment: Float
Link copied to clipboard
open var clickable: Boolean
Link copied to clipboard
open var expand: Boolean
Link copied to clipboard
open var fixedWidth: Int
Link copied to clipboard
open override val gtkBuildablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gtkCellLayoutPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gtkTreeViewColumnPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open var maxWidth: Int
Link copied to clipboard
open var minWidth: Int
Link copied to clipboard
Link copied to clipboard
open var resizable: Boolean
Link copied to clipboard
Link copied to clipboard
open var sortColumnId: 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.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var spacing: Int
Link copied to clipboard
open var title: String
Link copied to clipboard
open var visible: Boolean
Link copied to clipboard
open var widget: Widget?
Link copied to clipboard
open val width: Int
Link copied to clipboard
open val xOffset: Int

Functions

Link copied to clipboard
open override fun addAttribute(cellRenderer: CellRenderer, attribute: String, column: Int)

Adds an attribute mapping to the list in @tree_column.

Link copied to clipboard

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

Link copied to clipboard
open fun cellSetCellData(treeModel: TreeModel, iter: TreeIter, isExpander: Boolean, isExpanded: 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.

Link copied to clipboard
open override fun clear()

Unsets all the mappings on all renderers on the @tree_column.

Link copied to clipboard
open override fun clearAttributes(cellRenderer: CellRenderer)

Clears all existing attributes previously set with gtk_tree_view_column_set_attributes().

Link copied to clipboard
open fun clicked()

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

Link copied to clipboard
fun connectClicked(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when the column's header has been clicked.

Link copied to clipboard
open fun focusCell(cell: CellRenderer)

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

Link copied to clipboard
open fun getAlignment(): Float

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

Link copied to clipboard
open fun getArea(): CellArea?

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.

Link copied to clipboard
open fun getBuildableId(): String?

Gets the ID of the @buildable object.

Link copied to clipboard
open fun getButton(): Widget

Returns the button used in the treeview column header

Link copied to clipboard
open fun getCells(): <Error class: unknown class>

Returns the cell renderers which have been added to @cell_layout.

Link copied to clipboard
open fun getClickable(): Boolean

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

Link copied to clipboard
open fun getExpand(): Boolean

Returns true if the column expands to fill available space.

Link copied to clipboard
open fun getFixedWidth(): Int

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

Link copied to clipboard
open fun getMaxWidth(): Int

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

Link copied to clipboard
open fun getMinWidth(): Int

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

Link copied to clipboard

Returns true if the @tree_column can be reordered by the user.

Link copied to clipboard
open fun getResizable(): Boolean

Returns true if the @tree_column can be resized by the end user.

Link copied to clipboard

Returns the current type of @tree_column.

Link copied to clipboard
open fun getSortColumnId(): Int

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

Link copied to clipboard

Gets the value set by gtk_tree_view_column_set_sort_indicator().

Link copied to clipboard

Gets the value set by gtk_tree_view_column_set_sort_order().

Link copied to clipboard
open fun getSpacing(): Int

Returns the spacing of @tree_column.

Link copied to clipboard
open fun getTitle(): String

Returns the title of the widget.

Link copied to clipboard
open fun getTreeView(): Widget?

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

Link copied to clipboard
open fun getVisible(): Boolean

Returns true if @tree_column is visible.

Link copied to clipboard
open fun getWidget(): Widget?

Returns the GtkWidget in the button on the column header.

Link copied to clipboard
open fun getWidth(): Int

Returns the current size of @tree_column in pixels.

Link copied to clipboard
open fun getXOffset(): Int

Returns the current X offset of @tree_column in pixels.

Link copied to clipboard
open override fun packEnd(cell: CellRenderer, expand: Boolean)

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.

Link copied to clipboard
open override fun packStart(cell: CellRenderer, expand: Boolean)

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.

Link copied to clipboard
open fun queueResize()

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

Link copied to clipboard
open fun reorder(cell: CellRenderer, position: Int)

Re-inserts @cell at @position.

Link copied to clipboard
open fun setAlignment(xalign: 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.

Link copied to clipboard

Sets the GtkCellLayoutDataFunc to use for @cell_layout.

Link copied to clipboard
open fun setCellDataFunc_(cellRenderer: CellRenderer, func: TreeCellDataFunc)

Sets the GtkTreeCellDataFunc to use for the column.

Link copied to clipboard
open fun setClickable(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.

Link copied to clipboard
open fun setExpand(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.

Link copied to clipboard
open fun setFixedWidth(fixedWidth: Int)

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

Link copied to clipboard
open fun setMaxWidth(maxWidth: Int)

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.

Link copied to clipboard
open fun setMinWidth(minWidth: Int)

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

Link copied to clipboard
open fun setReorderable(reorderable: Boolean)

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

Link copied to clipboard
open fun setResizable(resizable: Boolean)

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

Link copied to clipboard

Sets the growth behavior of @tree_column to @type.

Link copied to clipboard
open fun setSortColumnId(sortColumnId: Int)

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.

Link copied to clipboard
open fun setSortIndicator(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.

Link copied to clipboard
open fun setSortOrder(order: SortType)

Changes the appearance of the sort indicator.

Link copied to clipboard
open fun setSpacing(spacing: Int)

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

Link copied to clipboard
open fun setTitle(title: String)

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

Link copied to clipboard
open fun setVisible(visible: Boolean)

Sets the visibility of @tree_column.

Link copied to clipboard
open fun setWidget(widget: Widget? = null)

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.