11.138Class GtkTreeViewColumn

A visible column in a GtkTreeView widget

Class GtkTreeViewColumn

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.

Methods
add_attributeAdds an attribute mapping to the list in tree_column.
cell_get_positionObtains the horizontal position and size of a cell in a column.
cell_get_sizeObtains the width and height needed to render the column.
cell_is_visibleReturns TRUE if any of the cells packed into the tree_column are visible.
cell_set_cell_dataSets the cell renderer based on the tree_model and iter.
clearUnsets all the mappings on all renderers on the tree_column.
clear_attributesClears all existing attributes previously set with gtk_tree_view_column_set_attributes().
clickedEmits the "clicked" signal on the column.
focus_cellSets the current keyboard focus to be at cell, if the column contains 2 or more editable and activatable cells.
get_alignmentReturns the current x alignment of tree_column.
get_clickableReturns TRUE if the user can click on the header for the column.
get_expandReturn TRUE if the column expands to take any available space.
get_fixed_widthGets the fixed width of the column.
get_max_widthReturns the maximum width in pixels of the tree_column, or -1 if no maximum width is set.
get_min_widthReturns the minimum width in pixels of the tree_column, or -1 if no minimum width is set.
get_reorderableReturns TRUE if the tree_column can be reordered by the user.
get_resizableReturns TRUE if the tree_column can be resized by the end user.
get_sizingReturns the current type of tree_column.
get_sort_column_idGets the logical sort_column_id that the model sorts on when this column is selected for sorting.
get_sort_indicatorGets the value set by gtk_tree_view_column_set_sort_indicator().
get_sort_orderGets the value set by gtk_tree_view_column_set_sort_order().
get_spacingReturns the spacing of tree_column.
get_titleReturns the title of the widget.
get_tree_viewReturns the GtkTreeView wherein tree_column has been inserted.
get_visibleReturns TRUE if tree_column is visible.
get_widgetReturns the GtkWidget in the button on the column header.
get_widthReturns the current size of tree_column in pixels.
new_with_attributesCreates a new GtkTreeViewColumn with a number of default values.
pack_endAdds the cell to end of the column.
pack_startPacks the cell into the beginning of the column.
queue_resizeFlags the column, and the cell renderers added to this column, to have their sizes renegotiated.
set_alignmentSets the alignment of the title or custom widget inside the column header.
set_attributesSets the attributes in the list as the attributes of tree_column.
set_cell_data_funcSets the GtkTreeViewColumnFunc to use for the column.
set_clickableSets the header to be active if active is TRUE.
set_expandSets the column to take available extra space.
set_fixed_widthSets the size of the column in pixels.
set_max_widthSets the maximum width of the tree_column.
set_min_widthSets the minimum width of the tree_column.
set_reorderableIf reorderable is TRUE, then the column can be reordered by the end user dragging the header.
set_resizableIf resizable is TRUE, then the user can explicitly resize the column by grabbing the outer edge of the column button.
set_sizingSets the growth behavior of tree_column to type.
set_sort_column_idSets the logical sort_column_id that this column sorts on when this column is selected for sorting.
set_sort_indicatorCall this function with a setting of TRUE to display an arrow in the header button indicating the column is sorted.
set_sort_orderChanges the appearance of the sort indicator.
set_spacingSets the spacing field of tree_column, which is the number of pixels to place between cell renderers packed into it.
set_titleSets the title of the tree_column.
set_visibleSets the visibility of tree_column.
set_widgetSets the widget in the header to be widget.
signal_clicked?

Methods

add_attribute

Adds an attribute mapping to the list in tree_column.

GtkTreeViewColumn.add_attribute( cell_renderer, attribute, column )
cell_renderer the GtkCellRenderer to set attributes on
attribute An attribute on the renderer
column The column position on the model to get the attribute from.

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.

cell_get_position

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

GtkTreeViewColumn.cell_get_position( cell )
cell a GtkCellRenderer
Returnan array [ horizontal position of cell within tree_column, width of cell ], or nil

If the cell is not found in the column, nil is returned.

cell_get_size

Obtains the width and height needed to render the column.

GtkTreeViewColumn.cell_get_size( cell_area )
cell_area The area (GdkRectangle) a cell in the column will be allocated, or NULL.
Returnan array [ x offset, y offset of a cell relative to cell_area, width, height needed to render a cell ]

This is used primarily by the GtkTreeView.

cell_is_visible

Returns TRUE if any of the cells packed into the tree_column are visible.

GtkTreeViewColumn.cell_is_visible()
ReturnTRUE, if any of the cells packed into the tree_column are currently visible

For this to be meaningful, you must first initialize the cells with gtk_tree_view_column_cell_set_cell_data()

cell_set_cell_data

Sets the cell renderer based on the tree_model and iter.

GtkTreeViewColumn.cell_set_cell_data( tree_model, iter, is_expander, is_expanded )
tree_model The GtkTreeModel to to get the cell renderers attributes from.
iter The GtkTreeIter 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

That is, forevery 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.

clear

Unsets all the mappings on all renderers on the tree_column.

GtkTreeViewColumn.clear()

clear_attributes

Clears all existing attributes previously set with gtk_tree_view_column_set_attributes().

GtkTreeViewColumn.clear_attributes( cell_renderer )
cell_renderer a GtkCellRenderer to clear the attribute mapping on.

clicked

Emits the "clicked" signal on the column.

GtkTreeViewColumn.clicked()

This function will only work if tree_column is clickable.

focus_cell

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

GtkTreeViewColumn.focus_cell( cell )
cell A GtkCellRenderer

get_alignment

Returns the current x alignment of tree_column.

GtkTreeViewColumn.get_alignment()

This value can range between 0.0 and 1.0.

get_clickable

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

GtkTreeViewColumn.get_clickable()
ReturnTRUE if user can click the column header.

get_expand

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

GtkTreeViewColumn.get_expand()
ReturnTRUE, if the column expands

get_fixed_width

Gets the fixed width of the column.

GtkTreeViewColumn.get_fixed_width()

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

get_max_width

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

GtkTreeViewColumn.get_max_width()
ReturnThe maximum width of the tree_column.

get_min_width

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

GtkTreeViewColumn.get_min_width()
ReturnThe minimum width of the tree_column.

get_reorderable

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

GtkTreeViewColumn.get_reorderable()
ReturnTRUE if the tree_column can be reordered by the user.

get_resizable

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

GtkTreeViewColumn.get_resizable()
ReturnTRUE, if the tree_column can be resized.

get_sizing

Returns the current type of tree_column.

GtkTreeViewColumn.get_sizing()
ReturnThe type of tree_column (GtkTreeViewColumnSizing).

get_sort_column_id

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

GtkTreeViewColumn.get_sort_column_id()
Returnthe current sort_column_id for this column, or -1 if this column can't be used for sorting.

See gtk_tree_view_column_set_sort_column_id().

get_sort_indicator

Gets the value set by gtk_tree_view_column_set_sort_indicator().

GtkTreeViewColumn.get_sort_indicator()
Returnwhether the sort indicator arrow is displayed

get_sort_order

Gets the value set by gtk_tree_view_column_set_sort_order().

GtkTreeViewColumn.get_sort_order()
Returnthe sort order the sort indicator is indicating (GtkSortType)

get_spacing

Returns the spacing of tree_column.

GtkTreeViewColumn.get_spacing()
Returnthe spacing of tree_column.

get_title

Returns the title of the widget.

GtkTreeViewColumn.get_title()
Returnthe title of the column.

get_tree_view

Returns the GtkTreeView wherein tree_column has been inserted.

GtkTreeViewColumn.get_tree_view()
ReturnThe tree view wherein column has been inserted if any, NULL otherwise.

If column is currently not inserted in any tree view, NULL is returned.

get_visible

Returns TRUE if tree_column is visible.

GtkTreeViewColumn.get_visible()
Returnwhether the column is visible or not. If it is visible, then the tree will show the column.

get_widget

Returns the GtkWidget in the button on the column header.

GtkTreeViewColumn.get_widget()
ReturnThe GtkWidget in the column header, or NULL

If a custom widget has not been set then NULL is returned.

get_width

Returns the current size of tree_column in pixels.

GtkTreeViewColumn.get_width()
ReturnThe current width of tree_column.

new_with_attributes

Creates a new GtkTreeViewColumn with a number of default values.

GtkTreeViewColumn.new_with_attributes( title, cell, attributes )
title The title to set the header to.
cell The GtkCellRenderer.
attributes An array of pairs [ attribute, column, ... ]
Returna new GtkTreeViewColumn

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.

pack_end

Adds the cell to end of the column.

GtkTreeViewColumn.pack_end( cell, expand )
cell The GtkCellRenderer.
expand TRUE if cell is to be given extra space allocated to tree_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.

pack_start

Packs the cell into the beginning of the column.

GtkTreeViewColumn.pack_start( cell, expand )
cell The GtkCellRenderer.
expand TRUE if cell is to be given extra space allocated to tree_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.

queue_resize

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

GtkTreeViewColumn.queue_resize()

set_alignment

Sets the alignment of the title or custom widget inside the column header.

GtkTreeViewColumn.set_alignment( xalign )
xalign The alignment, which is between [0.0 and 1.0] inclusive.

The alignment determines its location inside the button -- 0.0 for left, 0.5 for center, 1.0 for right.

set_attributes

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

GtkTreeViewColumn.set_attributes( cell_renderer, attributes )
cell_renderer the GtkCellRenderer we're setting the attributes of
attributes An array of pairs [ attribute, 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.

set_cell_data_func

Sets the GtkTreeViewColumnFunc to use for the column.

GtkTreeViewColumn.set_cell_data_func( cell_renderer, func, func_data )
cell_renderer A GtkCellRenderer
func The GtkTreeViewColumnFunc to use, or nil.
func_data The user data for func, or nil.

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.

set_clickable

Sets the header to be active if active is TRUE.

GtkTreeViewColumn.set_clickable( clickable )
clickable TRUE if the header is active.

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

set_expand

Sets the column to take available extra space.

GtkTreeViewColumn.set_expand( expand )
expand TRUE if the column should take available extra space, FALSE if not

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.

set_fixed_width

Sets the size of the column in pixels.

GtkTreeViewColumn.set_fixed_width( fixed_width )
fixed_width The size to set tree_column to. Must be greater than 0.

This is meaningful only if the sizing type is GTK_TREE_VIEW_COLUMN_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.

set_max_width

Sets the maximum width of the tree_column.

GtkTreeViewColumn.set_max_width( max_width )
max_width The maximum width of the column in pixels, or -1.

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.

set_min_width

Sets the minimum width of the tree_column.

GtkTreeViewColumn.set_min_width( min_width )
min_width The minimum width of the column in pixels, or -1.

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

set_reorderable

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

GtkTreeViewColumn.set_reorderable( reorderable )
reorderable TRUE, if the column can be reordered.

set_resizable

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

GtkTreeViewColumn.set_resizable( resizeable )
resizeable TRUE, if the column can be resized

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.

set_sizing

Sets the growth behavior of tree_column to type.

GtkTreeViewColumn.set_sizing( type )
type The GtkTreeViewColumnSizing.

set_sort_column_id

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

GtkTreeViewColumn.set_sort_column_id( sort_column_id )
sort_column_id The sort_column_id of the model to sort on.

Doing so makes the column header clickable.

set_sort_indicator

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

GtkTreeViewColumn.set_sort_indicator( setting )
setting TRUE to display an indicator that the column is sorted

Call gtk_tree_view_column_set_sort_order() to change the direction of the arrow.

set_sort_order

Changes the appearance of the sort indicator.

GtkTreeViewColumn.set_sort_order( order )
order sort order that the sort indicator should indicate (GtkSortType)

This does not actually sort the model. Use gtk_tree_view_column_set_sort_column_id() 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 gtk_tree_view_column_set_sort_indicator().

set_spacing

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

GtkTreeViewColumn.set_spacing( distance )
distance between cell renderers in pixels.

set_title

Sets the title of the tree_column.

GtkTreeViewColumn.set_title( title )
title The title of the tree_column.

If a custom widget has been set, then this value is ignored.

set_visible

Sets the visibility of tree_column.

GtkTreeViewColumn.set_visible( visible )
visible TRUE if the tree_column is visible.

set_widget

Sets the widget in the header to be widget.

GtkTreeViewColumn.set_widget( widget )
widget A child GtkWidget, or NULL.

If widget is NULL, then the header button is set with a GtkLabel set to the title of tree_column.

signal_clicked

?

GtkTreeViewColumn.signal_clicked()
Made with http://www.falconpl.org