CtkTreeViewColumn

CtkTreeViewColumn — A visible column in a CtkTreeView widget

Functions

void (*CtkTreeCellDataFunc) ()
CtkTreeViewColumn * ctk_tree_view_column_new ()
CtkTreeViewColumn * ctk_tree_view_column_new_with_area ()
CtkTreeViewColumn * ctk_tree_view_column_new_with_attributes ()
void ctk_tree_view_column_pack_start ()
void ctk_tree_view_column_pack_end ()
void ctk_tree_view_column_clear ()
void ctk_tree_view_column_add_attribute ()
void ctk_tree_view_column_set_attributes ()
void ctk_tree_view_column_set_cell_data_func ()
void ctk_tree_view_column_clear_attributes ()
void ctk_tree_view_column_set_spacing ()
gint ctk_tree_view_column_get_spacing ()
void ctk_tree_view_column_set_visible ()
gboolean ctk_tree_view_column_get_visible ()
void ctk_tree_view_column_set_resizable ()
gboolean ctk_tree_view_column_get_resizable ()
void ctk_tree_view_column_set_sizing ()
CtkTreeViewColumnSizing ctk_tree_view_column_get_sizing ()
gint ctk_tree_view_column_get_width ()
gint ctk_tree_view_column_get_fixed_width ()
void ctk_tree_view_column_set_fixed_width ()
void ctk_tree_view_column_set_min_width ()
gint ctk_tree_view_column_get_min_width ()
void ctk_tree_view_column_set_max_width ()
gint ctk_tree_view_column_get_max_width ()
void ctk_tree_view_column_clicked ()
void ctk_tree_view_column_set_title ()
const gchar * ctk_tree_view_column_get_title ()
void ctk_tree_view_column_set_expand ()
gboolean ctk_tree_view_column_get_expand ()
void ctk_tree_view_column_set_clickable ()
gboolean ctk_tree_view_column_get_clickable ()
void ctk_tree_view_column_set_widget ()
CtkWidget * ctk_tree_view_column_get_widget ()
CtkWidget * ctk_tree_view_column_get_button ()
void ctk_tree_view_column_set_alignment ()
gfloat ctk_tree_view_column_get_alignment ()
void ctk_tree_view_column_set_reorderable ()
gboolean ctk_tree_view_column_get_reorderable ()
void ctk_tree_view_column_set_sort_column_id ()
gint ctk_tree_view_column_get_sort_column_id ()
void ctk_tree_view_column_set_sort_indicator ()
gboolean ctk_tree_view_column_get_sort_indicator ()
void ctk_tree_view_column_set_sort_order ()
CtkSortType ctk_tree_view_column_get_sort_order ()
void ctk_tree_view_column_cell_set_cell_data ()
void ctk_tree_view_column_cell_get_size ()
gboolean ctk_tree_view_column_cell_get_position ()
gboolean ctk_tree_view_column_cell_is_visible ()
void ctk_tree_view_column_focus_cell ()
void ctk_tree_view_column_queue_resize ()
CtkWidget * ctk_tree_view_column_get_tree_view ()
gint ctk_tree_view_column_get_x_offset ()

Properties

float alignment Read / Write
CtkCellArea * cell-area Read / Write / Construct Only
gboolean clickable Read / Write
gboolean expand Read / Write
int fixed-width Read / Write
int max-width Read / Write
int min-width Read / Write
gboolean reorderable Read / Write
gboolean resizable Read / Write
CtkTreeViewColumnSizing sizing Read / Write
int sort-column-id Read / Write
gboolean sort-indicator Read / Write
CtkSortType sort-order Read / Write
int spacing Read / Write
char * title Read / Write
gboolean visible Read / Write
CtkWidget * widget Read / Write
int width Read
int x-offset Read

Signals

void clicked Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── CtkTreeViewColumn

Implemented Interfaces

CtkTreeViewColumn implements CtkCellLayout and CtkBuildable.

Includes

#include <ctk/ctk.h>

Description

The CtkTreeViewColumn object represents a visible column in a CtkTreeView 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.

Functions

CtkTreeCellDataFunc ()

void
(*CtkTreeCellDataFunc) (CtkTreeViewColumn *tree_column,
                        CtkCellRenderer *cell,
                        CtkTreeModel *tree_model,
                        CtkTreeIter *iter,
                        gpointer data);

A function to set the properties of a cell instead of just using the straight mapping between the cell and the model. This is useful for customizing the cell renderer. For example, a function might get an integer from the tree_model , and render it to the “text” attribute of “cell” by converting it to its written equivalent. This is set by calling ctk_tree_view_column_set_cell_data_func()

Parameters

tree_column

A CtkTreeViewColumn

 

cell

The CtkCellRenderer that is being rendered by tree_column

 

tree_model

The CtkTreeModel being rendered

 

iter

A CtkTreeIter of the current row rendered

 

data

user data.

[closure]

ctk_tree_view_column_new ()

CtkTreeViewColumn *
ctk_tree_view_column_new (void);

Creates a new CtkTreeViewColumn.

Returns

A newly created CtkTreeViewColumn.


ctk_tree_view_column_new_with_area ()

CtkTreeViewColumn *
ctk_tree_view_column_new_with_area (CtkCellArea *area);

Creates a new CtkTreeViewColumn using area to render its cells.

Parameters

area

the CtkCellArea that the newly created column should use to layout cells.

 

Returns

A newly created CtkTreeViewColumn.

Since: 3.0


ctk_tree_view_column_new_with_attributes ()

CtkTreeViewColumn *
ctk_tree_view_column_new_with_attributes
                               (const gchar *title,
                                CtkCellRenderer *cell,
                                ...);

Creates a new CtkTreeViewColumn with a number of default values. This is equivalent to calling ctk_tree_view_column_set_title(), ctk_tree_view_column_pack_start(), and ctk_tree_view_column_set_attributes() on the newly created CtkTreeViewColumn.

Here’s a simple example:

1
2
3
4
5
6
7
8
9
10
11
12
enum { TEXT_COLUMN, COLOR_COLUMN, N_COLUMNS };
// ...
{
  CtkTreeViewColumn *column;
  CtkCellRenderer   *renderer = ctk_cell_renderer_text_new ();

  column = ctk_tree_view_column_new_with_attributes ("Title",
                                                     renderer,
                                                     "text", TEXT_COLUMN,
                                                     "foreground", COLOR_COLUMN,
                                                     NULL);
}

Parameters

title

The title to set the header to

 

cell

The CtkCellRenderer

 

...

A NULL-terminated list of attributes

 

Returns

A newly created CtkTreeViewColumn.


ctk_tree_view_column_pack_start ()

void
ctk_tree_view_column_pack_start (CtkTreeViewColumn *tree_column,
                                 CtkCellRenderer *cell,
                                 gboolean 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.

Parameters

tree_column

A CtkTreeViewColumn.

 

cell

The CtkCellRenderer.

 

expand

TRUE if cell is to be given extra space allocated to tree_column .

 

ctk_tree_view_column_pack_end ()

void
ctk_tree_view_column_pack_end (CtkTreeViewColumn *tree_column,
                               CtkCellRenderer *cell,
                               gboolean 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.

Parameters

tree_column

A CtkTreeViewColumn.

 

cell

The CtkCellRenderer.

 

expand

TRUE if cell is to be given extra space allocated to tree_column .

 

ctk_tree_view_column_clear ()

void
ctk_tree_view_column_clear (CtkTreeViewColumn *tree_column);

Unsets all the mappings on all renderers on the tree_column .

Parameters

tree_column

A CtkTreeViewColumn

 

ctk_tree_view_column_add_attribute ()

void
ctk_tree_view_column_add_attribute (CtkTreeViewColumn *tree_column,
                                    CtkCellRenderer *cell_renderer,
                                    const gchar *attribute,
                                    gint column);

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

Parameters

tree_column

A CtkTreeViewColumn.

 

cell_renderer

the CtkCellRenderer to set attributes on

 

attribute

An attribute on the renderer

 

column

The column position on the model to get the attribute from.

 

ctk_tree_view_column_set_attributes ()

void
ctk_tree_view_column_set_attributes (CtkTreeViewColumn *tree_column,
                                     CtkCellRenderer *cell_renderer,
                                     ...);

Sets the attributes in the list as the attributes of tree_column . The attributes should be in attribute/column order, as in ctk_tree_view_column_add_attribute(). All existing attributes are removed, and replaced with the new attributes.

Parameters

tree_column

A CtkTreeViewColumn

 

cell_renderer

the CtkCellRenderer we’re setting the attributes of

 

...

A NULL-terminated list of attributes

 

ctk_tree_view_column_set_cell_data_func ()

void
ctk_tree_view_column_set_cell_data_func
                               (CtkTreeViewColumn *tree_column,
                                CtkCellRenderer *cell_renderer,
                                CtkTreeCellDataFunc func,
                                gpointer func_data,
                                GDestroyNotify destroy);

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

Parameters

tree_column

A CtkTreeViewColumn

 

cell_renderer

A CtkCellRenderer

 

func

The CtkTreeCellDataFunc to use.

[allow-none]

func_data

The user data for func .

[closure]

destroy

The destroy notification for func_data

 

ctk_tree_view_column_clear_attributes ()

void
ctk_tree_view_column_clear_attributes (CtkTreeViewColumn *tree_column,
                                       CtkCellRenderer *cell_renderer);

Clears all existing attributes previously set with ctk_tree_view_column_set_attributes().

Parameters

tree_column

a CtkTreeViewColumn

 

cell_renderer

a CtkCellRenderer to clear the attribute mapping on.

 

ctk_tree_view_column_set_spacing ()

void
ctk_tree_view_column_set_spacing (CtkTreeViewColumn *tree_column,
                                  gint spacing);

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

Parameters

tree_column

A CtkTreeViewColumn.

 

spacing

distance between cell renderers in pixels.

 

ctk_tree_view_column_get_spacing ()

gint
ctk_tree_view_column_get_spacing (CtkTreeViewColumn *tree_column);

Returns the spacing of tree_column .

Parameters

tree_column

A CtkTreeViewColumn.

 

Returns

the spacing of tree_column .


ctk_tree_view_column_set_visible ()

void
ctk_tree_view_column_set_visible (CtkTreeViewColumn *tree_column,
                                  gboolean visible);

Sets the visibility of tree_column .

Parameters

tree_column

A CtkTreeViewColumn.

 

visible

TRUE if the tree_column is visible.

 

ctk_tree_view_column_get_visible ()

gboolean
ctk_tree_view_column_get_visible (CtkTreeViewColumn *tree_column);

Returns TRUE if tree_column is visible.

Parameters

tree_column

A CtkTreeViewColumn.

 

Returns

whether the column is visible or not. If it is visible, then the tree will show the column.


ctk_tree_view_column_set_resizable ()

void
ctk_tree_view_column_set_resizable (CtkTreeViewColumn *tree_column,
                                    gboolean 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 CTK_TREE_VIEW_COLUMN_AUTOSIZE, then the sizing mode is changed to CTK_TREE_VIEW_COLUMN_GROW_ONLY.

Parameters

tree_column

A CtkTreeViewColumn

 

resizable

TRUE, if the column can be resized

 

ctk_tree_view_column_get_resizable ()

gboolean
ctk_tree_view_column_get_resizable (CtkTreeViewColumn *tree_column);

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

Parameters

tree_column

A CtkTreeViewColumn

 

Returns

TRUE, if the tree_column can be resized.


ctk_tree_view_column_set_sizing ()

void
ctk_tree_view_column_set_sizing (CtkTreeViewColumn *tree_column,
                                 CtkTreeViewColumnSizing type);

Sets the growth behavior of tree_column to type .

Parameters

tree_column

A CtkTreeViewColumn.

 

type

The CtkTreeViewColumnSizing.

 

ctk_tree_view_column_get_sizing ()

CtkTreeViewColumnSizing
ctk_tree_view_column_get_sizing (CtkTreeViewColumn *tree_column);

Returns the current type of tree_column .

Parameters

tree_column

A CtkTreeViewColumn.

 

Returns

The type of tree_column .


ctk_tree_view_column_get_width ()

gint
ctk_tree_view_column_get_width (CtkTreeViewColumn *tree_column);

Returns the current size of tree_column in pixels.

Parameters

tree_column

A CtkTreeViewColumn.

 

Returns

The current width of tree_column .


ctk_tree_view_column_get_fixed_width ()

gint
ctk_tree_view_column_get_fixed_width (CtkTreeViewColumn *tree_column);

Gets the fixed width of the column. This may not be the actual displayed width of the column; for that, use ctk_tree_view_column_get_width().

Parameters

tree_column

A CtkTreeViewColumn.

 

Returns

The fixed width of the column.


ctk_tree_view_column_set_fixed_width ()

void
ctk_tree_view_column_set_fixed_width (CtkTreeViewColumn *tree_column,
                                      gint 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 CTK_TREE_VIEW_COLUMN_GROW_ONLY or CTK_TREE_VIEW_COLUMN_AUTOSIZE, setting a fixed width overrides the automatically calculated width. Note that fixed_width is only a hint to CTK+; 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.

Parameters

tree_column

A CtkTreeViewColumn.

 

fixed_width

The new fixed width, in pixels, or -1.

 

ctk_tree_view_column_set_min_width ()

void
ctk_tree_view_column_set_min_width (CtkTreeViewColumn *tree_column,
                                    gint min_width);

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

Parameters

tree_column

A CtkTreeViewColumn.

 

min_width

The minimum width of the column in pixels, or -1.

 

ctk_tree_view_column_get_min_width ()

gint
ctk_tree_view_column_get_min_width (CtkTreeViewColumn *tree_column);

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

Parameters

tree_column

A CtkTreeViewColumn.

 

Returns

The minimum width of the tree_column .


ctk_tree_view_column_set_max_width ()

void
ctk_tree_view_column_set_max_width (CtkTreeViewColumn *tree_column,
                                    gint 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.

Parameters

tree_column

A CtkTreeViewColumn.

 

max_width

The maximum width of the column in pixels, or -1.

 

ctk_tree_view_column_get_max_width ()

gint
ctk_tree_view_column_get_max_width (CtkTreeViewColumn *tree_column);

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

Parameters

tree_column

A CtkTreeViewColumn.

 

Returns

The maximum width of the tree_column .


ctk_tree_view_column_clicked ()

void
ctk_tree_view_column_clicked (CtkTreeViewColumn *tree_column);

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

Parameters

tree_column

a CtkTreeViewColumn

 

ctk_tree_view_column_set_title ()

void
ctk_tree_view_column_set_title (CtkTreeViewColumn *tree_column,
                                const gchar *title);

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

Parameters

tree_column

A CtkTreeViewColumn.

 

title

The title of the tree_column .

 

ctk_tree_view_column_get_title ()

const gchar *
ctk_tree_view_column_get_title (CtkTreeViewColumn *tree_column);

Returns the title of the widget.

Parameters

tree_column

A CtkTreeViewColumn.

 

Returns

the title of the column. This string should not be modified or freed.


ctk_tree_view_column_set_expand ()

void
ctk_tree_view_column_set_expand (CtkTreeViewColumn *tree_column,
                                 gboolean 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.

Along with “fixed-width”, the “expand” property changes when the column is resized by the user.

Parameters

tree_column

A CtkTreeViewColumn.

 

expand

TRUE if the column should expand to fill available space.

 

Since: 2.4


ctk_tree_view_column_get_expand ()

gboolean
ctk_tree_view_column_get_expand (CtkTreeViewColumn *tree_column);

Returns TRUE if the column expands to fill available space.

Parameters

tree_column

A CtkTreeViewColumn.

 

Returns

TRUE if the column expands to fill available space.

Since: 2.4


ctk_tree_view_column_set_clickable ()

void
ctk_tree_view_column_set_clickable (CtkTreeViewColumn *tree_column,
                                    gboolean 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.

Parameters

tree_column

A CtkTreeViewColumn.

 

clickable

TRUE if the header is active.

 

ctk_tree_view_column_get_clickable ()

gboolean
ctk_tree_view_column_get_clickable (CtkTreeViewColumn *tree_column);

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

Parameters

tree_column

a CtkTreeViewColumn

 

Returns

TRUE if user can click the column header.


ctk_tree_view_column_set_widget ()

void
ctk_tree_view_column_set_widget (CtkTreeViewColumn *tree_column,
                                 CtkWidget *widget);

Sets the widget in the header to be widget . If widget is NULL, then the header button is set with a CtkLabel set to the title of tree_column .

Parameters

tree_column

A CtkTreeViewColumn.

 

widget

A child CtkWidget, or NULL.

[allow-none]

ctk_tree_view_column_get_widget ()

CtkWidget *
ctk_tree_view_column_get_widget (CtkTreeViewColumn *tree_column);

Returns the CtkWidget in the button on the column header. If a custom widget has not been set then NULL is returned.

Parameters

tree_column

A CtkTreeViewColumn.

 

Returns

The CtkWidget in the column header, or NULL.

[nullable][transfer none]


ctk_tree_view_column_get_button ()

CtkWidget *
ctk_tree_view_column_get_button (CtkTreeViewColumn *tree_column);

Returns the button used in the treeview column header

Parameters

tree_column

A CtkTreeViewColumn

 

Returns

The button for the column header.

[transfer none]

Since: 3.0


ctk_tree_view_column_set_alignment ()

void
ctk_tree_view_column_set_alignment (CtkTreeViewColumn *tree_column,
                                    gfloat 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.

Parameters

tree_column

A CtkTreeViewColumn.

 

xalign

The alignment, which is between [0.0 and 1.0] inclusive.

 

ctk_tree_view_column_get_alignment ()

gfloat
ctk_tree_view_column_get_alignment (CtkTreeViewColumn *tree_column);

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

Parameters

tree_column

A CtkTreeViewColumn.

 

Returns

The current alignent of tree_column .


ctk_tree_view_column_set_reorderable ()

void
ctk_tree_view_column_set_reorderable (CtkTreeViewColumn *tree_column,
                                      gboolean reorderable);

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

Parameters

tree_column

A CtkTreeViewColumn

 

reorderable

TRUE, if the column can be reordered.

 

ctk_tree_view_column_get_reorderable ()

gboolean
ctk_tree_view_column_get_reorderable (CtkTreeViewColumn *tree_column);

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

Parameters

tree_column

A CtkTreeViewColumn

 

Returns

TRUE if the tree_column can be reordered by the user.


ctk_tree_view_column_set_sort_column_id ()

void
ctk_tree_view_column_set_sort_column_id
                               (CtkTreeViewColumn *tree_column,
                                gint 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.

Parameters

tree_column

a CtkTreeViewColumn

 

sort_column_id

The sort_column_id of the model to sort on.

 

ctk_tree_view_column_get_sort_column_id ()

gint
ctk_tree_view_column_get_sort_column_id
                               (CtkTreeViewColumn *tree_column);

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

Parameters

tree_column

a CtkTreeViewColumn

 

Returns

the current sort_column_id for this column, or -1 if this column can’t be used for sorting.


ctk_tree_view_column_set_sort_indicator ()

void
ctk_tree_view_column_set_sort_indicator
                               (CtkTreeViewColumn *tree_column,
                                gboolean setting);

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

Parameters

tree_column

a CtkTreeViewColumn

 

setting

TRUE to display an indicator that the column is sorted

 

ctk_tree_view_column_get_sort_indicator ()

gboolean
ctk_tree_view_column_get_sort_indicator
                               (CtkTreeViewColumn *tree_column);

Gets the value set by ctk_tree_view_column_set_sort_indicator().

Parameters

tree_column

a CtkTreeViewColumn

 

Returns

whether the sort indicator arrow is displayed


ctk_tree_view_column_set_sort_order ()

void
ctk_tree_view_column_set_sort_order (CtkTreeViewColumn *tree_column,
                                     CtkSortType order);

Changes the appearance of the sort indicator.

This does not actually sort the model. Use ctk_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 ctk_tree_sortable_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 ctk_tree_view_column_set_sort_indicator().

Parameters

tree_column

a CtkTreeViewColumn

 

order

sort order that the sort indicator should indicate

 

ctk_tree_view_column_get_sort_order ()

CtkSortType
ctk_tree_view_column_get_sort_order (CtkTreeViewColumn *tree_column);

Gets the value set by ctk_tree_view_column_set_sort_order().

Parameters

tree_column

a CtkTreeViewColumn

 

Returns

the sort order the sort indicator is indicating


ctk_tree_view_column_cell_set_cell_data ()

void
ctk_tree_view_column_cell_set_cell_data
                               (CtkTreeViewColumn *tree_column,
                                CtkTreeModel *tree_model,
                                CtkTreeIter *iter,
                                gboolean is_expander,
                                gboolean is_expanded);

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

Parameters

tree_column

A CtkTreeViewColumn.

 

tree_model

The CtkTreeModel to to get the cell renderers attributes from.

 

iter

The CtkTreeIter 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

 

ctk_tree_view_column_cell_get_size ()

void
ctk_tree_view_column_cell_get_size (CtkTreeViewColumn *tree_column,
                                    const CdkRectangle *cell_area,
                                    gint *x_offset,
                                    gint *y_offset,
                                    gint *width,
                                    gint *height);

Obtains the width and height needed to render the column. This is used primarily by the CtkTreeView.

Parameters

tree_column

A CtkTreeViewColumn.

 

cell_area

The area a cell in the column will be allocated, or NULL.

[allow-none]

x_offset

location to return x offset of a cell relative to cell_area , or NULL.

[out][optional]

y_offset

location to return y offset of a cell relative to cell_area , or NULL.

[out][optional]

width

location to return width needed to render a cell, or NULL.

[out][optional]

height

location to return height needed to render a cell, or NULL.

[out][optional]

ctk_tree_view_column_cell_get_position ()

gboolean
ctk_tree_view_column_cell_get_position
                               (CtkTreeViewColumn *tree_column,
                                CtkCellRenderer *cell_renderer,
                                gint *x_offset,
                                gint *width);

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.

Parameters

tree_column

a CtkTreeViewColumn

 

cell_renderer

a CtkCellRenderer

 

x_offset

return location for the horizontal position of cell within tree_column , may be NULL.

[out][allow-none]

width

return location for the width of cell , may be NULL.

[out][allow-none]

Returns

TRUE if cell belongs to tree_column .


ctk_tree_view_column_cell_is_visible ()

gboolean
ctk_tree_view_column_cell_is_visible (CtkTreeViewColumn *tree_column);

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

Parameters

tree_column

A CtkTreeViewColumn

 

Returns

TRUE, if any of the cells packed into the tree_column are currently visible


ctk_tree_view_column_focus_cell ()

void
ctk_tree_view_column_focus_cell (CtkTreeViewColumn *tree_column,
                                 CtkCellRenderer *cell);

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

Parameters

tree_column

A CtkTreeViewColumn

 

cell

A CtkCellRenderer

 

Since: 2.2


ctk_tree_view_column_queue_resize ()

void
ctk_tree_view_column_queue_resize (CtkTreeViewColumn *tree_column);

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

Parameters

tree_column

A CtkTreeViewColumn

 

Since: 2.8


ctk_tree_view_column_get_tree_view ()

CtkWidget *
ctk_tree_view_column_get_tree_view (CtkTreeViewColumn *tree_column);

Returns the CtkTreeView wherein tree_column has been inserted. If column is currently not inserted in any tree view, NULL is returned.

Parameters

tree_column

A CtkTreeViewColumn

 

Returns

The tree view wherein column has been inserted if any, NULL otherwise.

[nullable][transfer none]

Since: 2.12


ctk_tree_view_column_get_x_offset ()

gint
ctk_tree_view_column_get_x_offset (CtkTreeViewColumn *tree_column);

Returns the current X offset of tree_column in pixels.

Parameters

tree_column

A CtkTreeViewColumn.

 

Returns

The current X offset of tree_column .

Since: 3.2

Types and Values

enum CtkTreeViewColumnSizing

The sizing method the column uses to determine its width. Please note that CTK_TREE_VIEW_COLUMN_AUTOSIZE are inefficient for large views, and can make columns appear choppy.

Members

CTK_TREE_VIEW_COLUMN_GROW_ONLY

Columns only get bigger in reaction to changes in the model

 

CTK_TREE_VIEW_COLUMN_AUTOSIZE

Columns resize to be the optimal size everytime the model changes.

 

CTK_TREE_VIEW_COLUMN_FIXED

Columns are a fixed numbers of pixels wide.

 

struct CtkTreeViewColumn

struct CtkTreeViewColumn;

Property Details

The “alignment” property

  “alignment”                float

X Alignment of the column header text or widget.

Owner: CtkTreeViewColumn

Flags: Read / Write

Allowed values: [0,1]

Default value: 0


The “cell-area” property

  “cell-area”                CtkCellArea *

The CtkCellArea used to layout cell renderers for this column.

If no area is specified when creating the tree view column with ctk_tree_view_column_new_with_area() a horizontally oriented CtkCellAreaBox will be used.

Owner: CtkTreeViewColumn

Flags: Read / Write / Construct Only

Since: 3.0


The “clickable” property

  “clickable”                gboolean

Whether the header can be clicked.

Owner: CtkTreeViewColumn

Flags: Read / Write

Default value: FALSE


The “expand” property

  “expand”                   gboolean

Column gets share of extra width allocated to the widget.

Owner: CtkTreeViewColumn

Flags: Read / Write

Default value: FALSE


The “fixed-width” property

  “fixed-width”              int

Current fixed width of the column.

Owner: CtkTreeViewColumn

Flags: Read / Write

Allowed values: >= -1

Default value: -1


The “max-width” property

  “max-width”                int

Maximum allowed width of the column.

Owner: CtkTreeViewColumn

Flags: Read / Write

Allowed values: >= -1

Default value: -1


The “min-width” property

  “min-width”                int

Minimum allowed width of the column.

Owner: CtkTreeViewColumn

Flags: Read / Write

Allowed values: >= -1

Default value: -1


The “reorderable” property

  “reorderable”              gboolean

Whether the column can be reordered around the headers.

Owner: CtkTreeViewColumn

Flags: Read / Write

Default value: FALSE


The “resizable” property

  “resizable”                gboolean

Column is user-resizable.

Owner: CtkTreeViewColumn

Flags: Read / Write

Default value: FALSE


The “sizing” property

  “sizing”                   CtkTreeViewColumnSizing

Resize mode of the column.

Owner: CtkTreeViewColumn

Flags: Read / Write

Default value: CTK_TREE_VIEW_COLUMN_GROW_ONLY


The “sort-column-id” property

  “sort-column-id”           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.

Owner: CtkTreeViewColumn

Flags: Read / Write

Allowed values: >= -1

Default value: -1

Since: 2.18


The “sort-indicator” property

  “sort-indicator”           gboolean

Whether to show a sort indicator.

Owner: CtkTreeViewColumn

Flags: Read / Write

Default value: FALSE


The “sort-order” property

  “sort-order”               CtkSortType

Sort direction the sort indicator should indicate.

Owner: CtkTreeViewColumn

Flags: Read / Write

Default value: CTK_SORT_ASCENDING


The “spacing” property

  “spacing”                  int

Space which is inserted between cells.

Owner: CtkTreeViewColumn

Flags: Read / Write

Allowed values: >= 0

Default value: 0


The “title” property

  “title”                    char *

Title to appear in column header.

Owner: CtkTreeViewColumn

Flags: Read / Write

Default value: ""


The “visible” property

  “visible”                  gboolean

Whether to display the column.

Owner: CtkTreeViewColumn

Flags: Read / Write

Default value: TRUE


The “widget” property

  “widget”                   CtkWidget *

Widget to put in column header button instead of column title.

Owner: CtkTreeViewColumn

Flags: Read / Write


The “width” property

  “width”                    int

Current width of the column.

Owner: CtkTreeViewColumn

Flags: Read

Allowed values: >= 0

Default value: 0


The “x-offset” property

  “x-offset”                 int

Current X position of the column.

Owner: CtkTreeViewColumn

Flags: Read

Allowed values: >= -2147483647

Default value: 0

Signal Details

The “clicked” signal

void
user_function (CtkTreeViewColumn *ctktreeviewcolumn,
               gpointer           user_data)

Flags: Run Last

See Also

CtkTreeView, CtkTreeSelection, CtkTreeModel, CtkTreeSortable, CtkTreeModelSort, CtkListStore, CtkTreeStore, CtkCellRenderer, CtkCellEditable, CtkCellRendererPixbuf, CtkCellRendererText, CtkCellRendererToggle, CtkTreeView drag-and-drop