GTK+ Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
"visible" gboolean : Read / Write "width" gint : Read "sizing" GtkTreeViewColumnSizing : Read / Write "fixed-width" gint : Read / Write "min-width" gint : Read / Write "max-width" gint : Read / Write "title" gchararray : Read / Write "clickable" gboolean : Read / Write "widget" GtkWidget : Read / Write "alignment" gfloat : Read / Write "reorderable" gboolean : Read / Write "sort-indicator" gboolean : Read / Write "sort-order" GtkSortType : Read / Write |
"clicked" void user_function (GtkTreeViewColumn *treeviewcolumn, gpointer user_data); |
typedef enum { GTK_TREE_VIEW_COLUMN_GROW_ONLY, GTK_TREE_VIEW_COLUMN_RESIZABLE, GTK_TREE_VIEW_COLUMN_AUTOSIZE, GTK_TREE_VIEW_COLUMN_FIXED } GtkTreeViewColumnSizing; |
void (*GtkTreeCellDataFunc) (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data); |
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_pack_start, 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_pack_start (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, gboolean expand); |
tree_column : | A GtkTreeViewColumn. |
cell : | The GtkCellRenderer, |
expand : | TRUE if cell is to be given extra space allocated to box. |
void gtk_tree_view_column_pack_end (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, gboolean expand); |
GList* gtk_tree_view_column_get_cell_renderers (GtkTreeViewColumn *tree_column); |
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.
tree_column : | A GtkTreeViewColumn. |
cell_renderer : | the GtkCellRenderer to set attributes on |
attribute : | An attribute on the renderer |
column : | The column position on the model to get the attribute from. |
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.
tree_column : | A GtkTreeViewColumn. |
cell_renderer : | the GtkCellRenderer we're setting the attributes of |
... : | A NULL terminated listing of attributes. |
void gtk_tree_view_column_set_cell_data_func (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell_renderer, GtkTreeCellDataFunc func, gpointer func_data, GtkDestroyNotify destroy); |
Sets the GtkTreeViewColumnFunc 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.
tree_column : | A GtkTreeViewColumn |
cell_renderer : | A GtkCellRenderer |
func : | The GtkTreeViewColumnFunc to use. |
func_data : | The user data for func. |
destroy : | The destroy notification for func_data |
void gtk_tree_view_column_clear_attributes (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell_renderer); |
Clears all existing attributes previously set with gtk_tree_view_column_set_attributes().
tree_column : | a GtkTreeViewColumn |
cell_renderer : | a GtkCellRenderer to clear the attribute mapping on. |
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.
tree_column : | A GtkTreeViewColumn. |
spacing : | distance between cell renderers in pixels. |
gint gtk_tree_view_column_get_spacing (GtkTreeViewColumn *tree_column); |
tree_column : | A GtkTreeViewColumn. |
Returns : | the spacing of tree_column. |
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. |
GtkTreeViewColumnSizing 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); |
Returns the current size of the tree_column in pixels.
tree_column : | A GtkTreeViewColumn. |
Returns : | The current width of the tree_column. |
gint gtk_tree_view_column_get_fixed_width (GtkTreeViewColumn *tree_column); |
Gets the fixed width of the column. This value is only meaning may not be the actual width of the column on the screen, just what is requested.
tree_column : | a GtkTreeViewColumn |
Returns : | the fixed width of the column |
void gtk_tree_view_column_set_fixed_width (GtkTreeViewColumn *tree_column, gint fixed_width); |
Sets the size of the column in pixels. This is meaningful only if the sizing type is GTK_TREE_VIEW_COLUMN_FIXED. 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. |
fixed_width : | 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. 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 the view.
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_clicked (GtkTreeViewColumn *tree_column); |
Emits the "clicked" signal on the column. This function will only work if the user could have conceivably clicked on the button.
tree_column : | a GtkTreeViewColumn |
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 clickable); |
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. |
clickable : | TRUE if the header is active. |
gboolean gtk_tree_view_column_get_clickable (GtkTreeViewColumn *tree_column); |
Returns TRUE if the user can click on the header for the column.
tree_column : | a GtkTreeViewColumn |
Returns : | whether the user can click the column header |
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. The alignment determines its location inside the button -- 0.0 for left, 0.5 for center, 1.0 for right.
tree_column : | A GtkTreeViewColumn. |
xalign : | The alignment, which is between [0.0 and 1.0] inclusive. |
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.
tree_column : | A GtkTreeViewColumn. |
Returns : | The current alignent of tree_column. |
void gtk_tree_view_column_set_reorderable (GtkTreeViewColumn *tree_column, gboolean reorderable); |
gboolean gtk_tree_view_column_get_reorderable (GtkTreeViewColumn *tree_column); |
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.
tree_column : | a GtkTreeViewColumn |
sort_column_id : | The sort_column_id of the model to sort on. |
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 coumn is selected for sorting. See gtk_tree_view_column_set_sort_column_id().
tree_column : | a GtkTreeViewColumn |
Returns : | the current sort_column_id for this column, or -1 if this column can't be used for sorting. |
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.
tree_column : | a GtkTreeViewColumn |
setting : | TRUE to display an indicator that the column is sorted |
gboolean gtk_tree_view_column_get_sort_indicator (GtkTreeViewColumn *tree_column); |
Gets the value set by gtk_tree_view_column_set_sort_indicator().
tree_column : | a GtkTreeViewColumn |
Returns : | whether the sort indicator arrow is displayed |
void gtk_tree_view_column_set_sort_order (GtkTreeViewColumn *tree_column, GtkSortType order); |
Changes the appearance of the sort indicator. (This <emphasis>does not</emphasis> actually sort the model. Use gtk_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 #gtk_tree_sortable_set_sort_column() 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_tree_view_column_set_sort_indicator().
tree_column : | a GtkTreeViewColumn |
order : | sort order that the sort indicator should indicate |
GtkSortType gtk_tree_view_column_get_sort_order (GtkTreeViewColumn *tree_column); |
Gets the value set by gtk_tree_view_column_set_sort_order().
tree_column : | a GtkTreeViewColumn |
Returns : | the sort order the sort indicator is indicating |
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 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. This is used primarily by the GtkTreeView.
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. |
is_expander : | TRUE, if the row has children |
is_expanded : | TRUE, if the row has visible children |
void gtk_tree_view_column_cell_get_size (GtkTreeViewColumn *tree_column, 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.
tree_column : | A GtkTreeViewColumn. |
cell_area : | The area a the column will be allocated, or NULL |
x_offset : | location to return x offset of cell relative to cell_area, or NULL |
y_offset : | location to return y offset of cell relative to cell_area, or NULL |
width : | location to return width needed to render a cell, or NULL |
height : | location to return height needed to render a cell, or NULL |
void gtk_tree_view_column_cell_render (GtkTreeViewColumn *tree_column, GdkWindow *window, GdkRectangle *background_area, GdkRectangle *cell_area, GdkRectangle *expose_area, guint flags); |
Renders the cell contained by tree_column. This is used primarily by the GtkTreeView.
tree_column : | A GtkTreeViewColumn. |
window : | a GdkDrawable to draw to |
background_area : | entire cell area (including tree expanders and maybe padding on the sides) |
cell_area : | area normally rendered by a cell renderer |
expose_area : | area that actually needs updating |
flags : | flags that affect rendering |
gboolean gtk_tree_view_column_cell_event (GtkTreeViewColumn *tree_column, GdkEvent *event, gchar *path_string, GdkRectangle *background_area, GdkRectangle *cell_area, guint flags); |
gboolean gtk_tree_view_column_cell_focus (GtkTreeViewColumn *tree_column, gint direction); |
void gtk_tree_view_column_cell_draw_focus (GtkTreeViewColumn *tree_column, GdkWindow *window, GdkRectangle *background_area, GdkRectangle *cell_area, GdkRectangle *expose_area, guint flags); |
gboolean gtk_tree_view_column_cell_is_visible (GtkTreeViewColumn *tree_column); |
void gtk_tree_view_column_cell_set_dirty (GtkTreeViewColumn *tree_column); |