Functions
GtkTreeCellDataFunc ()
void
(*GtkTreeCellDataFunc) (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell,
GtkTreeModel *tree_model,
GtkTreeIter *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 gtk_tree_view_column_set_cell_data_func()
gtk_tree_view_column_pack_start ()
void
gtk_tree_view_column_pack_start (GtkTreeViewColumn *tree_column,
GtkCellRenderer *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.
gtk_tree_view_column_pack_end ()
void
gtk_tree_view_column_pack_end (GtkTreeViewColumn *tree_column,
GtkCellRenderer *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.
gtk_tree_view_column_clear ()
void
gtk_tree_view_column_clear (GtkTreeViewColumn *tree_column);
Unsets all the mappings on all renderers on the tree_column
.
gtk_tree_view_column_add_attribute ()
void
gtk_tree_view_column_add_attribute (GtkTreeViewColumn *tree_column,
GtkCellRenderer *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 GtkCellRendererText get its values from
column 2.
gtk_tree_view_column_set_attributes ()
void
gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell_renderer,
...);
Sets the attributes in the list as the attributes of tree_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.
gtk_tree_view_column_set_cell_data_func ()
void
gtk_tree_view_column_set_cell_data_func
(GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell_renderer,
GtkTreeCellDataFunc func,
gpointer func_data,
GDestroyNotify destroy);
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 tree_column
's
cell renderer as appropriate. func
may be NULL to remove an
older one.
gtk_tree_view_column_set_spacing ()
void
gtk_tree_view_column_set_spacing (GtkTreeViewColumn *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.
gtk_tree_view_column_get_spacing ()
gint
gtk_tree_view_column_get_spacing (GtkTreeViewColumn *tree_column);
Returns the spacing of tree_column
.
Returns
the spacing of tree_column
.
gtk_tree_view_column_set_visible ()
void
gtk_tree_view_column_set_visible (GtkTreeViewColumn *tree_column,
gboolean visible);
Sets the visibility of tree_column
.
gtk_tree_view_column_get_visible ()
gboolean
gtk_tree_view_column_get_visible (GtkTreeViewColumn *tree_column);
Returns TRUE if tree_column
is visible.
Returns
whether the column is visible or not. If it is visible, then
the tree will show the column.
gtk_tree_view_column_get_resizable ()
gboolean
gtk_tree_view_column_get_resizable (GtkTreeViewColumn *tree_column);
Returns TRUE if the tree_column
can be resized by the end user.
Returns
TRUE, if the tree_column
can be resized.
gtk_tree_view_column_get_sizing ()
GtkTreeViewColumnSizing
gtk_tree_view_column_get_sizing (GtkTreeViewColumn *tree_column);
Returns the current type of tree_column
.
Returns
The type of tree_column
.
gtk_tree_view_column_get_width ()
gint
gtk_tree_view_column_get_width (GtkTreeViewColumn *tree_column);
Returns the current size of tree_column
in pixels.
Returns
The current width of tree_column
.
gtk_tree_view_column_get_fixed_width ()
gint
gtk_tree_view_column_get_fixed_width (GtkTreeViewColumn *tree_column);
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().
Returns
The fixed width of the column.
gtk_tree_view_column_set_fixed_width ()
void
gtk_tree_view_column_set_fixed_width (GtkTreeViewColumn *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
GTK_TREE_VIEW_COLUMN_GROW_ONLY or GTK_TREE_VIEW_COLUMN_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.
gtk_tree_view_column_set_min_width ()
void
gtk_tree_view_column_set_min_width (GtkTreeViewColumn *tree_column,
gint min_width);
Sets the minimum width of the tree_column
. If min_width
is -1, then the
minimum width is unset.
gtk_tree_view_column_get_min_width ()
gint
gtk_tree_view_column_get_min_width (GtkTreeViewColumn *tree_column);
Returns the minimum width in pixels of the tree_column
, or -1 if no minimum
width is set.
Returns
The minimum width of the tree_column
.
gtk_tree_view_column_set_max_width ()
void
gtk_tree_view_column_set_max_width (GtkTreeViewColumn *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.
gtk_tree_view_column_get_max_width ()
gint
gtk_tree_view_column_get_max_width (GtkTreeViewColumn *tree_column);
Returns the maximum width in pixels of the tree_column
, or -1 if no maximum
width is set.
Returns
The maximum width of the tree_column
.
gtk_tree_view_column_clicked ()
void
gtk_tree_view_column_clicked (GtkTreeViewColumn *tree_column);
Emits the “clicked” signal on the column. This function will only work if
tree_column
is clickable.
gtk_tree_view_column_set_title ()
void
gtk_tree_view_column_set_title (GtkTreeViewColumn *tree_column,
const gchar *title);
Sets the title of the tree_column
. If a custom widget has been set, then
this value is ignored.
gtk_tree_view_column_get_title ()
const gchar *
gtk_tree_view_column_get_title (GtkTreeViewColumn *tree_column);
Returns the title of the widget.
Returns
the title of the column. This string should not be
modified or freed.
gtk_tree_view_column_set_expand ()
void
gtk_tree_view_column_set_expand (GtkTreeViewColumn *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.
Since: 2.4
gtk_tree_view_column_get_expand ()
gboolean
gtk_tree_view_column_get_expand (GtkTreeViewColumn *tree_column);
Returns TRUE if the column expands to fill available space.
Returns
TRUE if the column expands to fill available space.
Since: 2.4
gtk_tree_view_column_set_clickable ()
void
gtk_tree_view_column_set_clickable (GtkTreeViewColumn *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.
gtk_tree_view_column_get_clickable ()
gboolean
gtk_tree_view_column_get_clickable (GtkTreeViewColumn *tree_column);
Returns TRUE if the user can click on the header for the column.
Returns
TRUE if user can click the column header.
gtk_tree_view_column_set_widget ()
void
gtk_tree_view_column_set_widget (GtkTreeViewColumn *tree_column,
GtkWidget *widget);
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
.
gtk_tree_view_column_get_widget ()
GtkWidget *
gtk_tree_view_column_get_widget (GtkTreeViewColumn *tree_column);
Returns the GtkWidget in the button on the column header.
If a custom widget has not been set then NULL is returned.
Returns
The GtkWidget in the column
header, or NULL.
[nullable][transfer none]
gtk_tree_view_column_get_button ()
GtkWidget *
gtk_tree_view_column_get_button (GtkTreeViewColumn *tree_column);
Returns the button used in the treeview column header
Returns
The button for the column header.
[transfer none]
Since: 3.0
gtk_tree_view_column_set_alignment ()
void
gtk_tree_view_column_set_alignment (GtkTreeViewColumn *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.
gtk_tree_view_column_get_alignment ()
gfloat
gtk_tree_view_column_get_alignment (GtkTreeViewColumn *tree_column);
Returns the current x alignment of tree_column
. This value can range
between 0.0 and 1.0.
Returns
The current alignent of tree_column
.
gtk_tree_view_column_set_reorderable ()
void
gtk_tree_view_column_set_reorderable (GtkTreeViewColumn *tree_column,
gboolean reorderable);
If reorderable
is TRUE, then the column can be reordered by the end user
dragging the header.
gtk_tree_view_column_get_reorderable ()
gboolean
gtk_tree_view_column_get_reorderable (GtkTreeViewColumn *tree_column);
Returns TRUE if the tree_column
can be reordered by the user.
Returns
TRUE if the tree_column
can be reordered by the user.
gtk_tree_view_column_set_sort_column_id ()
void
gtk_tree_view_column_set_sort_column_id
(GtkTreeViewColumn *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.
gtk_tree_view_column_get_sort_column_id ()
gint
gtk_tree_view_column_get_sort_column_id
(GtkTreeViewColumn *tree_column);
Gets the logical sort_column_id
that the model sorts on when this
column is selected for sorting.
See gtk_tree_view_column_set_sort_column_id().
Returns
the current sort_column_id
for this column, or -1 if
this column can’t be used for sorting.
gtk_tree_view_column_set_sort_indicator ()
void
gtk_tree_view_column_set_sort_indicator
(GtkTreeViewColumn *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
gtk_tree_view_column_set_sort_order() to change the direction of
the arrow.
gtk_tree_view_column_cell_set_cell_data ()
void
gtk_tree_view_column_cell_set_cell_data
(GtkTreeViewColumn *tree_column,
GtkTreeModel *tree_model,
GtkTreeIter *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 GtkTreeView.
gtk_tree_view_column_cell_get_size ()
void
gtk_tree_view_column_cell_get_size (GtkTreeViewColumn *tree_column,
const GdkRectangle *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 GtkTreeView.
gtk_tree_view_column_cell_get_position ()
gboolean
gtk_tree_view_column_cell_get_position
(GtkTreeViewColumn *tree_column,
GtkCellRenderer *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.
Returns
TRUE if cell
belongs to tree_column
.
gtk_tree_view_column_cell_is_visible ()
gboolean
gtk_tree_view_column_cell_is_visible (GtkTreeViewColumn *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
gtk_tree_view_column_cell_set_cell_data()
Returns
TRUE, if any of the cells packed into the tree_column
are currently visible
gtk_tree_view_column_focus_cell ()
void
gtk_tree_view_column_focus_cell (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell);
Sets the current keyboard focus to be at cell
, if the column contains
2 or more editable and activatable cells.
Since: 2.2
gtk_tree_view_column_queue_resize ()
void
gtk_tree_view_column_queue_resize (GtkTreeViewColumn *tree_column);
Flags the column, and the cell renderers added to this column, to have
their sizes renegotiated.
Since: 2.8
gtk_tree_view_column_get_tree_view ()
GtkWidget *
gtk_tree_view_column_get_tree_view (GtkTreeViewColumn *tree_column);
Returns the GtkTreeView wherein tree_column
has been inserted.
If column
is currently not inserted in any tree view, NULL is
returned.
Returns
The tree view wherein column
has
been inserted if any, NULL otherwise.
[nullable][transfer none]
Since: 2.12
gtk_tree_view_column_get_x_offset ()
gint
gtk_tree_view_column_get_x_offset (GtkTreeViewColumn *tree_column);
Returns the current X offset of tree_column
in pixels.
Returns
The current X offset of tree_column
.
Since: 3.2