Gtk.TreeViewColumn¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/co |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w |
|||
r/w/en |
|||
r/w |
|||
r |
|||
r |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the column’s header has been clicked. |
Fields¶
- Inherited:
Class Details¶
- class Gtk.TreeViewColumn(title='', cell_renderer=None, **attributes)¶
- Bases:
- Abstract:
No
A visible column in a [class`Gtk`.TreeView] widget
The
GtkTreeViewColumn
object represents a visible column in aGtkTreeView
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 [class`Gtk`.TreeView] documentation for specifics about the CSS node structure for treeviews and their headers.
Deprecated since version 4.10: Use [class`Gtk`.ColumnView] and [class`Gtk`.ColumnViewColumn] instead of [class`Gtk`.TreeView] to show a tabular list
- classmethod new()[source]¶
- Returns:
A newly created
GtkTreeViewColumn
.- Return type:
Creates a new
GtkTreeViewColumn
.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- classmethod new_with_area(area)[source]¶
- Parameters:
area (
Gtk.CellArea
) – theGtkCellArea
that the newly created column should use to layout cells.- Returns:
A newly created
GtkTreeViewColumn
.- Return type:
Creates a new
GtkTreeViewColumn
using area to render its cells.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- add_attribute(cell_renderer, attribute, column)[source]¶
- Parameters:
cell_renderer (
Gtk.CellRenderer
) – theGtkCellRenderer
to set attributes onattribute (
str
) – An attribute on the renderercolumn (
int
) – The column position on the model to get the attribute from.
Adds an attribute mapping to the list in self.
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.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- cell_get_position(cell_renderer)[source]¶
- Parameters:
cell_renderer (
Gtk.CellRenderer
) – aGtk.CellRenderer
- Returns:
None
if cell does not belong to self or a tuple containing:- x_offset:
the horizontal position of cell within self
- width:
the width of cell
- Return type:
Obtains the horizontal position and size of a cell in a column. If the cell is not found in the column
None
is returned.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- cell_get_size()[source]¶
- Returns:
- x_offset:
location to return x offset of a cell relative to cell_area
- y_offset:
location to return y offset of a cell relative to cell_area
- width:
location to return width needed to render a cell
- height:
location to return height needed to render a cell
- Return type:
Obtains the width and height needed to render the column. This is used primarily by the
GtkTreeView
.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- cell_is_visible()[source]¶
-
Returns
True
if any of the cells packed into the self are visible. For this to be meaningful, you must first initialize the cells withGtk.TreeViewColumn.cell_set_cell_data
()Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- cell_set_cell_data(tree_model, iter, is_expander, is_expanded)[source]¶
- Parameters:
tree_model (
Gtk.TreeModel
) – TheGtkTreeModel
to get the cell renderers attributes from.iter (
Gtk.TreeIter
) – TheGtkTreeIter
to get the cell renderer’s attributes from.
Sets the cell renderer based on the tree_model and iter. That is, for every attribute mapping in self, 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
.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- clear()[source]¶
Unsets all the mappings on all renderers on the self.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- clear_attributes(cell_renderer)[source]¶
- Parameters:
cell_renderer (
Gtk.CellRenderer
) – aGtkCellRenderer
to clear the attribute mapping on.
Clears all existing attributes previously set with
Gtk.TreeViewColumn.set_attributes
().Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- clicked()[source]¶
Emits the “clicked” signal on the column. This function will only work if self is clickable.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- focus_cell(cell)[source]¶
- Parameters:
cell (
Gtk.CellRenderer
) – AGtkCellRenderer
Sets the current keyboard focus to be at cell, if the column contains 2 or more editable and activatable cells.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_alignment()[source]¶
- Returns:
The current alignent of self.
- Return type:
Returns the current x alignment of self. This value can range between 0.0 and 1.0.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_button()[source]¶
- Returns:
The button for the column header.
- Return type:
Returns the button used in the treeview column header
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_clickable()[source]¶
-
Returns
True
if the user can click on the header for the column.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_expand()[source]¶
-
Returns
True
if the column expands to fill available space.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_fixed_width()[source]¶
- Returns:
The fixed width of the column.
- Return type:
Gets the fixed width of the column. This may not be the actual displayed width of the column; for that, use
Gtk.TreeViewColumn.get_width
().Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_max_width()[source]¶
- Returns:
The maximum width of the self.
- Return type:
Returns the maximum width in pixels of the self, or -1 if no maximum width is set.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_min_width()[source]¶
- Returns:
The minimum width of the self.
- Return type:
Returns the minimum width in pixels of the self, or -1 if no minimum width is set.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_reorderable()[source]¶
-
Returns
True
if the self can be reordered by the user.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_resizable()[source]¶
-
Returns
True
if the self can be resized by the end user.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_sizing()[source]¶
- Returns:
The type of self.
- Return type:
Returns the current type of self.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_sort_column_id()[source]¶
- Returns:
the current sort_column_id for this column, or -1 if this column can’t be used for sorting
- Return type:
Gets the logical sort_column_id that the model sorts on when this column is selected for sorting.
See [method`Gtk`.TreeViewColumn.set_sort_column_id].
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_sort_indicator()[source]¶
- Returns:
whether the sort indicator arrow is displayed
- Return type:
Gets the value set by
Gtk.TreeViewColumn.set_sort_indicator
().Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_sort_order()[source]¶
- Returns:
the sort order the sort indicator is indicating
- Return type:
Gets the value set by
Gtk.TreeViewColumn.set_sort_order
().Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_spacing()[source]¶
- Returns:
the spacing of self.
- Return type:
Returns the spacing of self.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_title()[source]¶
- Returns:
the title of the column. This string should not be modified or freed.
- Return type:
Returns the title of the widget.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_tree_view()[source]¶
- Returns:
The tree view wherein column has been inserted
- Return type:
Gtk.Widget
orNone
Returns the
GtkTreeView
wherein self has been inserted. If column is currently not inserted in any tree view,None
is returned.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_visible()[source]¶
- Returns:
whether the column is visible or not. If it is visible, then the tree will show the column.
- Return type:
Returns
True
if self is visible.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_widget()[source]¶
- Returns:
The
GtkWidget
in the column header- Return type:
Gtk.Widget
orNone
Returns the
GtkWidget
in the button on the column header.If a custom widget has not been set then
None
is returned.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_width()[source]¶
- Returns:
The current width of self.
- Return type:
Returns the current size of self in pixels.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- get_x_offset()[source]¶
- Returns:
The current X offset of self.
- Return type:
Returns the current X offset of self in pixels.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- pack_end(cell, expand)[source]¶
- Parameters:
cell (
Gtk.CellRenderer
) – TheGtkCellRenderer
expand (
bool
) –True
if cell is to be given extra space allocated to self.
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 isTrue
.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- pack_start(cell, expand)[source]¶
- Parameters:
cell (
Gtk.CellRenderer
) – TheGtkCellRenderer
expand (
bool
) –True
if cell is to be given extra space allocated to self.
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 isTrue
.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- queue_resize()[source]¶
Flags the column, and the cell renderers added to this column, to have their sizes renegotiated.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_alignment(xalign)[source]¶
- Parameters:
xalign (
float
) – The alignment, which is between [0.0 and 1.0] inclusive.
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.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_attributes(cell_renderer, **attributes)[source]¶
- Parameters:
cell_renderer (
Gtk.CellRenderer
) – theGtk.CellRenderer
we’re setting the attributes of
Sets the attributes in the list as the attributes of self.
The attributes should be in attribute/column order, as in
Gtk.TreeViewColumn.add_attribute
(). All existing attributes are removed, and replaced with the new attributes.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_cell_data_func(cell_renderer, func, *func_data)[source]¶
- Parameters:
cell_renderer (
Gtk.CellRenderer
) – AGtkCellRenderer
func (
Gtk.TreeCellDataFunc
orNone
) – TheGtkTreeCellDataFunc
to use.
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 self's cell renderer as appropriate. func may be
None
to remove an older one.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_clickable(clickable)[source]¶
-
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.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_expand(expand)[source]¶
-
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 thisFalse
.Along with “fixed-width”, the “expand” property changes when the column is resized by the user.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_fixed_width(fixed_width)[source]¶
- Parameters:
fixed_width (
int
) – The new fixed width, in pixels, or -1.
If fixed_width is not -1, sets the fixed width of self; 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.TreeViewColumnSizing.GROW_ONLY
orGtk.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.Along with “expand”, the “fixed-width” property changes when the column is resized by the user.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_max_width(max_width)[source]¶
- Parameters:
max_width (
int
) – The maximum width of the column in pixels, or -1.
Sets the maximum width of the self. 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.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_min_width(min_width)[source]¶
- Parameters:
min_width (
int
) – The minimum width of the column in pixels, or -1.
Sets the minimum width of the self. If min_width is -1, then the minimum width is unset.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_reorderable(reorderable)[source]¶
-
If reorderable is
True
, then the column can be reordered by the end user dragging the header.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_resizable(resizable)[source]¶
-
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 isGtk.TreeViewColumnSizing.AUTOSIZE
, then the sizing mode is changed toGtk.TreeViewColumnSizing.GROW_ONLY
.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_sizing(type)[source]¶
- Parameters:
type (
Gtk.TreeViewColumnSizing
) – The ``GtkTreeViewColumn``Sizing.
Sets the growth behavior of self to type.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_sort_column_id(sort_column_id)[source]¶
- Parameters:
sort_column_id (
int
) – The sort_column_id of the model to sort on.
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.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_sort_indicator(setting)[source]¶
-
Call this function with a setting of
True
to display an arrow in the header button indicating the column is sorted. CallGtk.TreeViewColumn.set_sort_order
() to change the direction of the arrow.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_sort_order(order)[source]¶
- Parameters:
order (
Gtk.SortType
) – sort order that the sort indicator should indicate
Changes the appearance of the sort indicator.
This does not actually sort the model. Use
Gtk.TreeViewColumn.set_sort_column_id
() if you want automatic sorting support. This function is primarily for custom sorting behavior, and should be used in conjunction withGtk.TreeSortable.set_sort_column_id
() 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.TreeViewColumn.set_sort_indicator
().Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_spacing(spacing)[source]¶
- Parameters:
spacing (
int
) – distance between cell renderers in pixels.
Sets the spacing field of self, which is the number of pixels to place between cell renderers packed into it.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_title(title)[source]¶
- Parameters:
title (
str
) – The title of the self.
Sets the title of the self. If a custom widget has been set, then this value is ignored.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_visible(visible)[source]¶
-
Sets the visibility of self.
Deprecated since version 4.10: Use
Gtk.ColumnView
instead
- set_widget(widget)[source]¶
- Parameters:
widget (
Gtk.Widget
orNone
) – A childGtkWidget
Sets the widget in the header to be widget. If widget is
None
, then the header button is set with aGtkLabel
set to the title of self.Deprecated since version 4.10: Use
Gtk.ColumnView
instead
Signal Details¶
- Gtk.TreeViewColumn.signals.clicked(tree_view_column)¶
- Signal Name:
clicked
- Flags:
- Parameters:
tree_view_column (
Gtk.TreeViewColumn
) – The object which received the signal
Emitted when the column’s header has been clicked.
Property Details¶
- Gtk.TreeViewColumn.props.alignment¶
- Name:
alignment
- Type:
- Default Value:
0.0
- Flags:
- Gtk.TreeViewColumn.props.cell_area¶
- Name:
cell-area
- Type:
- Default Value:
- Flags:
The
GtkCellArea
used to layout cell renderers for this column.If no area is specified when creating the tree view column with
Gtk.TreeViewColumn.new_with_area
() a horizontally orientedGtkCellAreaBox
will be used.
- Gtk.TreeViewColumn.props.clickable¶
- Name:
clickable
- Type:
- Default Value:
- Flags:
- Gtk.TreeViewColumn.props.expand¶
- Name:
expand
- Type:
- Default Value:
- Flags:
- Gtk.TreeViewColumn.props.fixed_width¶
- Name:
fixed-width
- Type:
- Default Value:
-1
- Flags:
- Gtk.TreeViewColumn.props.max_width¶
- Name:
max-width
- Type:
- Default Value:
-1
- Flags:
- Gtk.TreeViewColumn.props.min_width¶
- Name:
min-width
- Type:
- Default Value:
-1
- Flags:
- Gtk.TreeViewColumn.props.reorderable¶
- Name:
reorderable
- Type:
- Default Value:
- Flags:
- Gtk.TreeViewColumn.props.resizable¶
- Name:
resizable
- Type:
- Default Value:
- Flags:
- Gtk.TreeViewColumn.props.sizing¶
- Name:
sizing
- Type:
- Default Value:
- Flags:
- Gtk.TreeViewColumn.props.sort_column_id¶
- Name:
sort-column-id
- Type:
- Default Value:
-1
- Flags:
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.props.sort_indicator¶
- Name:
sort-indicator
- Type:
- Default Value:
- Flags:
- Gtk.TreeViewColumn.props.sort_order¶
- Name:
sort-order
- Type:
- Default Value:
- Flags:
- Gtk.TreeViewColumn.props.spacing¶
- Name:
spacing
- Type:
- Default Value:
0
- Flags:
- Gtk.TreeViewColumn.props.visible¶
- Name:
visible
- Type:
- Default Value:
- Flags:
- Gtk.TreeViewColumn.props.widget¶
- Name:
widget
- Type:
- Default Value:
- Flags: