| GTK+ Reference Manual | |||
|---|---|---|---|
| <<< Previous Page | Home | Up | Next Page >>> |
struct GtkTreeViewColumn
{
GtkObject parent;
GtkWidget *tree_view;
GtkWidget *button;
GtkWidget *child;
GtkWidget *arrow;
GtkWidget *alignment;
GdkWindow *window;
gfloat xalign;
guint model_changed_signal;
gint width;
gint min_width;
gint max_width;
gint displayed_width;
GtkCellDataFunc func;
gpointer func_data;
GtkDestroyNotify destroy;
gchar *title;
GtkCellRenderer *cell;
GSList *attributes;
GtkTreeViewColumnSizing column_type;
/* Sorting */
guint sort_clicked_signal;
guint sort_column_changed_signal;
gint sort_column_id;
GtkTreeSortOrder sort_order;
guint visible : 1;
guint button_active : 1;
guint dirty : 1;
guint show_sort_indicator : 1;
}; |
typedef enum
{
GTK_TREE_VIEW_COLUMN_RESIZEABLE,
GTK_TREE_VIEW_COLUMN_AUTOSIZE,
GTK_TREE_VIEW_COLUMN_FIXED
} GtkTreeViewColumnSizing; |
GtkTreeViewColumn* gtk_tree_view_column_new (void); |
Creates a new GtkTreeViewColumn.
| Returns : | A newly created GtkTreeViewColumn. |
GtkTreeViewColumn* gtk_tree_view_column_new_with_attributes (const gchar *title, GtkCellRenderer *cell, ...); |
Creates a new GtkTreeViewColumn with a number of default values. This is equivalent to calling gtk_tree_view_column_set_title, gtk_tree_view_column_set_cell_renderer, and gtk_tree_view_column_set_attributes on the newly created GtkTreeViewColumn.
| title : | The title to set the header to. |
| cell : | The GtkCellRenderer. |
| ... : | A NULL terminated list of attributes. |
| Returns : | A newly created GtkTreeViewColumn. |
void gtk_tree_view_column_set_cell_renderer
(GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell); |
Sets the cell renderer of the tree_column. If there is a cell renderer already set, then it is removed. If cell is NULL, then the cell renderer is unset.
| tree_column : | A GtkTreeViewColumn. |
| cell : | The GtkCellRenderer, or NULL. |
void gtk_tree_view_column_add_attribute
(GtkTreeViewColumn *tree_column,
const gchar *attribute,
gint column); |
Adds an attribute mapping to the list in tree_column. The column is the column position on the model to get a value from, and the attribute is the parameter on the tree_column's cell renderer to set that value to.
| tree_column : | A GtkTreeViewColumn. |
| attribute : | An attribute on the columns cell |
| column : | The column position on the model to get the attribute from. |
void gtk_tree_view_column_set_attributes
(GtkTreeViewColumn *tree_column,
...); |
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.
| tree_column : | A GtkTreeViewColumn. |
| ... : | A NULL terminated listing of attributes. |
void gtk_tree_view_column_set_cell_data
(GtkTreeViewColumn *tree_column,
GtkTreeModel *tree_model,
GtkTreeIter *iter); |
Sets the cell renderer based on the tree_model and tree_node. That is, for every attribute mapping in tree_column, it will get a value from the set column on the tree_node, and use that value to set the attribute on the cell renderer.
| tree_column : | A GtkTreeViewColumn. |
| tree_model : | The GtkTreeModel to to get the cell renderers attributes from. |
| iter : | The GtkTreeIter to to get the cell renderer's attributes from. |
void gtk_tree_view_column_set_visible
(GtkTreeViewColumn *tree_column,
gboolean visible); |
Sets the visibility of tree_column.
| tree_column : | A GtkTreeViewColumn. |
| visible : | TRUE if the tree_column is visible. |
gboolean gtk_tree_view_column_get_visible (GtkTreeViewColumn *tree_column); |
Returns TRUE if tree_column is visible.
| tree_column : | A GtkTreeViewColumn. |
| Returns : | whether the column is visible or not. If it is visible, then the tree will show the column. |
void gtk_tree_view_column_set_sizing (GtkTreeViewColumn *tree_column, GtkTreeViewColumnSizing type); |
Sets the growth behavior of tree_column to type.
| tree_column : | A GtkTreeViewColumn. |
| type : | The GtkTreeViewColumnSizing. |
gint gtk_tree_view_column_get_sizing (GtkTreeViewColumn *tree_column); |
Returns the current type of tree_column.
| tree_column : | A GtkTreeViewColumn. |
| Returns : | The type of tree_column. |
gint gtk_tree_view_column_get_width (GtkTreeViewColumn *tree_column); |
Gets the value set by gtk_tree_view_column_set_width().
| tree_column : | a GtkTreeViewColumn |
| Returns : | the width of the column |
void gtk_tree_view_column_set_width (GtkTreeViewColumn *tree_column, gint size); |
Sets the size of the column in pixels, unless the the column type is GTK_TREE_VIEW_COLUMN_AUTOSIZE. In this case, the value is discarded as the size of the column is based on the calculated width of the column. The width is clamped to the min/max width for the column.
| tree_column : | A GtkTreeViewColumn. |
| size : | The size to set the tree_column to. |
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.
| tree_column : | A GtkTreeViewColumn. |
| min_width : | The minimum width of the column in pixels, or -1. |
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.
| tree_column : | A GtkTreeViewColumn. |
| Returns : | The minimum width of the tree_column. |
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.
| tree_column : | A GtkTreeViewColumn. |
| max_width : | The maximum width of the column in pixels, or -1. |
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.
| tree_column : | A GtkTreeViewColumn. |
| Returns : | The maximum width of the tree_column. |
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.
| tree_column : | A GtkTreeViewColumn. |
| title : | The title of the tree_column. |
G_CONST_RETURN gchar* gtk_tree_view_column_get_title (GtkTreeViewColumn *tree_column); |
Returns the title of the widget. This value should not be modified.
| tree_column : | A GtkTreeViewColumn. |
| Returns : | the title of the column. |
void gtk_tree_view_column_set_clickable
(GtkTreeViewColumn *tree_column,
gboolean active); |
Sets the header to be active if active is TRUE. When the header is active, then it can take keyboard focus, and can be clicked.
| tree_column : | A GtkTreeViewColumn. |
| active : | TRUE if the header is active. |
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.
| tree_column : | A GtkTreeViewColumn. |
| widget : | A child GtkWidget, or NULL. |
GtkWidget* gtk_tree_view_column_get_widget (GtkTreeViewColumn *tree_column); |
Returns the GtkWidget in the button in the column header. If a custom widget has not been set, then this will be a GtkAlignment with a GtkLabel in it.
| tree_column : | A GtkTreeViewColumn. |
| Returns : | The GtkWidget in the column header. |
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.
| tree_column : | A GtkTreeViewColumn. |
| xalign : | alignment (0.0 for left, 0.5 for center, 1.0 for right) |
gfloat gtk_tree_view_column_get_alignment (GtkTreeViewColumn *tree_column); |
void gtk_tree_view_column_clicked (GtkTreeViewColumn *tree_column); |
Emits the "clicked" signal on the column.
| tree_column : | a GtkTreeViewColumn |