TreeViewColumn

A visible column in a gtk.tree_view.TreeView widget

The gtk.tree_view_column.TreeViewColumn object represents a visible column in a gtk.tree_view.TreeView 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 gtk.tree_view.TreeView documentation for specifics about the CSS node structure for treeviews and their headers.

More...
class TreeViewColumn : InitiallyUnowned , Buildable , CellLayout {}

Constructors

this
this()

Creates a new gtk.tree_view_column.TreeViewColumn.

Members

Functions

addAttribute
void addAttribute(gtk.cell_renderer.CellRenderer cellRenderer, string attribute, int column)

Adds an attribute mapping to the list in tree_column.

cellGetPosition
bool cellGetPosition(gtk.cell_renderer.CellRenderer cellRenderer, int xOffset, int width)

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

cellGetSize
void cellGetSize(int xOffset, int yOffset, int width, int height)

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

cellIsVisible
bool cellIsVisible()

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

cellSetCellData
void cellSetCellData(gtk.tree_model.TreeModel treeModel, gtk.tree_iter.TreeIter iter, bool isExpander, bool isExpanded)

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

clear
void clear()

Unsets all the mappings on all renderers on the tree_column.

clearAttributes
void clearAttributes(gtk.cell_renderer.CellRenderer cellRenderer)

Clears all existing attributes previously set with gtk.tree_view_column.TreeViewColumn.setAttributes.

clicked
void clicked()

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

connectClicked
ulong connectClicked(T callback, Flag!"After" after)

Connect to Clicked signal.

focusCell
void focusCell(gtk.cell_renderer.CellRenderer cell)

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

getAlignment
float getAlignment()

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

getButton
gtk.widget.Widget getButton()

Returns the button used in the treeview column header

getClickable
bool getClickable()

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

getExpand
bool getExpand()

Returns true if the column expands to fill available space.

getFixedWidth
int getFixedWidth()

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

getMaxWidth
int getMaxWidth()

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

getMinWidth
int getMinWidth()

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

getReorderable
bool getReorderable()

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

getResizable
bool getResizable()

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

getSizing
gtk.types.TreeViewColumnSizing getSizing()

Returns the current type of tree_column.

getSortColumnId
int getSortColumnId()

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

getSortIndicator
bool getSortIndicator()

Gets the value set by gtk.tree_view_column.TreeViewColumn.setSortIndicator.

getSortOrder
gtk.types.SortType getSortOrder()

Gets the value set by gtk.tree_view_column.TreeViewColumn.setSortOrder.

getSpacing
int getSpacing()

Returns the spacing of tree_column.

getTitle
string getTitle()

Returns the title of the widget.

getTreeView
gtk.widget.Widget getTreeView()

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

getVisible
bool getVisible()

Returns true if tree_column is visible.

getWidget
gtk.widget.Widget getWidget()

Returns the gtk.widget.Widget in the button on the column header.

getWidth
int getWidth()

Returns the current size of tree_column in pixels.

getXOffset
int getXOffset()

Returns the current X offset of tree_column in pixels.

packEnd
void packEnd(gtk.cell_renderer.CellRenderer cell, bool expand)

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.

packStart
void packStart(gtk.cell_renderer.CellRenderer cell, bool expand)

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.

queueResize
void queueResize()

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

setAlignment
void setAlignment(float xalign)

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.

setCellDataFunc
void setCellDataFunc(gtk.cell_renderer.CellRenderer cellRenderer, gtk.types.TreeCellDataFunc func)

Sets the gtk.types.TreeCellDataFunc to use for the column.

setClickable
void setClickable(bool 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.

setExpand
void setExpand(bool 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.

setFixedWidth
void setFixedWidth(int fixedWidth)

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.types.TreeViewColumnSizing.GrowOnly or gtk.types.TreeViewColumnSizing.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.

setMaxWidth
void setMaxWidth(int maxWidth)

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.

setMinWidth
void setMinWidth(int minWidth)

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

setReorderable
void setReorderable(bool reorderable)

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

setResizable
void setResizable(bool resizable)

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

setSizing
void setSizing(gtk.types.TreeViewColumnSizing type)

Sets the growth behavior of tree_column to type.

setSortColumnId
void setSortColumnId(int sortColumnId)

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.

setSortIndicator
void setSortIndicator(bool setting)

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.TreeViewColumn.setSortOrder to change the direction of the arrow.

setSortOrder
void setSortOrder(gtk.types.SortType order)

Changes the appearance of the sort indicator.

setSpacing
void setSpacing(int spacing)

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

setTitle
void setTitle(string title)

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

setVisible
void setVisible(bool visible)

Sets the visibility of tree_column.

setWidget
void setWidget(gtk.widget.Widget widget)

Sets the widget in the header to be widget. If widget is null, then the header button is set with a gtk.label.Label set to the title of tree_column.

Static functions

newWithArea
gtk.tree_view_column.TreeViewColumn newWithArea(gtk.cell_area.CellArea area)

Creates a new gtk.tree_view_column.TreeViewColumn using area to render its cells.

Mixed In Members

From mixin BuildableT!()

getBuildableId
string getBuildableId()

Gets the ID of the buildable object.

From mixin CellLayoutT!()

addAttribute
void addAttribute(gtk.cell_renderer.CellRenderer cell, string attribute, int column)

Adds an attribute mapping to the list in cell_layout.

clear
void clear()

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

clearAttributes
void clearAttributes(gtk.cell_renderer.CellRenderer cell)

Clears all existing attributes previously set with gtk.cell_layout.CellLayout.setAttributes.

getArea
gtk.cell_area.CellArea getArea()

Returns the underlying gtk.cell_area.CellArea which might be cell_layout if called on a gtk.cell_area.CellArea or might be null if no gtk.cell_area.CellArea is used by cell_layout.

getCells
gtk.cell_renderer.CellRenderer[] getCells()

Returns the cell renderers which have been added to cell_layout.

packEnd
void packEnd(gtk.cell_renderer.CellRenderer cell, bool expand)

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.

packStart
void packStart(gtk.cell_renderer.CellRenderer cell, bool expand)

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.

reorder
void reorder(gtk.cell_renderer.CellRenderer cell, int position)

Re-inserts cell at position.

setCellDataFunc
void setCellDataFunc(gtk.cell_renderer.CellRenderer cell, gtk.types.CellLayoutDataFunc func)

Sets the gtk.cell_layout.CellLayoutDataFunc to use for cell_layout.

Inherited Members

From Buildable

getBuildableId
string getBuildableId()

Gets the ID of the buildable object.

From CellLayout

addAttribute
void addAttribute(gtk.cell_renderer.CellRenderer cell, string attribute, int column)

Adds an attribute mapping to the list in cell_layout.

clear
void clear()

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

clearAttributes
void clearAttributes(gtk.cell_renderer.CellRenderer cell)

Clears all existing attributes previously set with gtk.cell_layout.CellLayout.setAttributes.

getArea
gtk.cell_area.CellArea getArea()

Returns the underlying gtk.cell_area.CellArea which might be cell_layout if called on a gtk.cell_area.CellArea or might be null if no gtk.cell_area.CellArea is used by cell_layout.

getCells
gtk.cell_renderer.CellRenderer[] getCells()

Returns the cell renderers which have been added to cell_layout.

packEnd
void packEnd(gtk.cell_renderer.CellRenderer cell, bool expand)

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.

packStart
void packStart(gtk.cell_renderer.CellRenderer cell, bool expand)

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.

reorder
void reorder(gtk.cell_renderer.CellRenderer cell, int position)

Re-inserts cell at position.

setCellDataFunc
void setCellDataFunc(gtk.cell_renderer.CellRenderer cell, gtk.types.CellLayoutDataFunc func)

Sets the gtk.cell_layout.CellLayoutDataFunc to use for cell_layout.

Detailed Description