| GTK+ Reference Manual | |||
|---|---|---|---|
| <<< Previous Page | Home | Up | Next Page >>> |
struct GtkTreeViewColumn
{
GtkObject parent;
GtkWidget *tree_view;
GtkWidget *button;
GdkWindow *window;
GtkJustification justification;
gint id;
gint size;
gint min_width;
gint max_width;
GtkTreeViewColumnFunc *func;
gpointer func_data;
gchar *title;
GtkCellRenderer *cell;
GSList *attributes;
GtkTreeViewColumnType column_type;
guint visible : 1;
guint button_active : 1;
guint dirty : 1;
}; |
typedef enum
{
GTK_TREE_VIEW_COLUMN_RESIZEABLE,
GTK_TREE_VIEW_COLUMN_AUTOSIZE,
GTK_TREE_VIEW_COLUMN_FIXED
} GtkTreeViewColumnType; |
gboolean (*GtkTreeViewColumnFunc) (GtkTreeViewColumn *tree_column, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data); |
| tree_column : | |
| tree_model : | |
| iter : | |
| data : | |
| Returns : |
GtkTreeViewColumn* gtk_tree_view_column_new (void); |
Creates a new GtkTreeViewColumn.
| Returns : | A newly created GtkTreeViewColumn. |
GtkTreeViewColumn* gtk_tree_view_column_new_with_attributes (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, and unsets the current attributes. 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,
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,
...); |
Adds the attributes in the list the the tree_column. The attributes should be in attribute/column order, as in gtk_tree_view_column_add_attribute. If the list is empty, then all attributes are removed.
| tree_column : | A GtkTreeViewColumn. |
| ... : | A NULL terminated listing of attributes to add. |
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_col_type
(GtkTreeViewColumn *tree_column,
GtkTreeViewColumnType type); |
Sets the growth behavior of tree_column to type.
| tree_column : | A GtkTreeViewColumn. |
| type : | The GtkTreeViewColumnType. |
gint gtk_tree_view_column_get_col_type (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_size (GtkTreeViewColumn *tree_column); |
Returns the current size of the tree_column in pixels.
| tree_column : | A GtkTreeViewColumn. |
| Returns : | The current size of the tree_column. |
void gtk_tree_view_column_set_size (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.
| 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, 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. |
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_header_active
(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_justification
(GtkTreeViewColumn *tree_column,
GtkJustification justification); |
Sets the justification of the title inside the column header. If a custom widget has been set, then this value is discarded.
| tree_column : | A GtkTreeViewColumn. |
| justification : | The justification of the title. |
GtkJustification gtk_tree_view_column_get_justification (GtkTreeViewColumn *tree_column); |
| tree_column : | |
| Returns : |