gtk.TreeViewColumn

class TreeViewColumn : gobject.ObjectG.ObjectG, gtk.BuildableIF.BuildableIF, gtk.CellLayoutIF.CellLayoutIF;
The GtkTreeViewColumn object represents a visible column in a #GtkTreeView 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][TreeWidget] for an overview of all the objects and data types related to the tree widget and how they work together.

protected GtkTreeViewColumn* gtkTreeViewColumn ;
the main Gtk struct

GtkTreeViewColumn* getTreeViewColumnStruct ();
Get the main Gtk struct

protected void* getStruct ();
the main Gtk struct as a void*

this(GtkTreeViewColumn* gtkTreeViewColumn, bool ownedRef = false);
Sets our main struct and passes it to the parent class.

this(string header, CellRenderer renderer, string type, int column);
Creates a new Tree view column

Params:
string header th column header text
CellRenderer renderer the rederer for the column cells
string type the type of data to be displayed (shouldn't this be on the renderer?)
int column the column number

Throws:
ConstructionException GTK+ fails to create the object.

Button getButton ();
Returns the button used in the treeview column header

Returns:
The button for the column header. [transfer none] Since 3.0

TreeView getTreeView ();
Returns the GtkTreeView wherein tree_column has been inserted. If column is currently not inserted in any tree view, NULL is returned. Since 2.12

Returns:
The tree view wherein column has been inserted if any, NULL otherwise. [transfer none]

static GType getType ();
this();
Creates a new #GtkTreeViewColumn.

Returns:
A newly created #GtkTreeViewColumn.

Throws:
ConstructionException GTK+ fails to create the object.

this(CellArea area);
Creates a new #GtkTreeViewColumn using @area to render its cells.

Params:
CellArea area the #GtkCellArea that the newly created column should use to layout cells.

Returns:
A newly created #GtkTreeViewColumn.

Since:
3.0

Throws:
ConstructionException GTK+ fails to create the object.

bool cellGetPosition (CellRenderer cellRenderer, out int xOffset, out int 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.

Params:
CellRenderer cellRenderer a #GtkCellRenderer
int xOffset return location for the horizontal position of @cell within @tree_column, may be %NULL
int width return location for the width of @cell, may be %NULL

Returns:
%TRUE if @cell belongs to @tree_column.

void cellGetSize (GdkRectangle* cellArea, out int xOffset, out int yOffset, out int width, out int height);
Obtains the width and height needed to render the column. This is used primarily by the #GtkTreeView.

Params:
GdkRectangle* cellArea The area a cell in the column will be allocated, or %NULL
int xOffset location to return x offset of a cell relative to @cell_area, or %NULL
int yOffset location to return y offset of a cell relative to @cell_area, or %NULL
int width location to return width needed to render a cell, or %NULL
int height location to return height needed to render a cell, or %NULL

bool cellIsVisible ();
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

void cellSetCellData (TreeModelIF treeModel, TreeIter iter, bool isExpander, bool isExpanded);
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.

Params:
TreeModelIF treeModel The #GtkTreeModel to to get the cell renderers attributes from.
TreeIter iter The #GtkTreeIter to to get the cell renderer’s attributes from.
bool isExpander %TRUE, if the row has children
bool isExpanded %TRUE, if the row has visible children

void clicked ();
Emits the “ clicked ” signal on the column. This function will only work if @tree_column is clickable.

void focusCell (CellRenderer cell);
Sets the current keyboard focus to be at @cell, if the column contains 2 or more editable and activatable cells.

Params:
CellRenderer cell A #GtkCellRenderer

Since:
2.2

float getAlignment ();
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.

bool getClickable ();
Returns %TRUE if the user can click on the header for the column.

Returns:
%TRUE if user can click the column header.

bool getExpand ();
Returns %TRUE if the column expands to fill available space.

Returns:
%TRUE if the column expands to fill available space.

Since:
2.4

int getFixedWidth ();
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.

int getMaxWidth ();
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.

int getMinWidth ();
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.

bool getReorderable ();
Returns %TRUE if the @tree_column can be reordered by the user.

Returns:
%TRUE if the @tree_column can be reordered by the user.

bool getResizable ();
Returns %TRUE if the @tree_column can be resized by the end user.

Returns:
%TRUE, if the @tree_column can be resized.

GtkTreeViewColumnSizing getSizing ();
Returns the current type of @tree_column.

Returns:
The type of @tree_column.

int getSortColumnId ();
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.

bool getSortIndicator ();
Gets the value set by gtk_tree_view_column_set_sort_indicator().

Returns:
whether the sort indicator arrow is displayed

GtkSortType getSortOrder ();
Gets the value set by gtk_tree_view_column_set_sort_order().

Returns:
the sort order the sort indicator is indicating

int getSpacing ();
Returns the spacing of @tree_column.

Returns:
the spacing of @tree_column.

string getTitle ();
Returns the title of the widget.

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

bool getVisible ();
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.

Widget getWidget ();
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

int getWidth ();
Returns the current size of @tree_column in pixels.

Returns:
The current width of @tree_column.

int getXOffset ();
Returns the current X offset of @tree_column in pixels.

Returns:
The current X offset of @tree_column.

Since:
3.2

void queueResize ();
Flags the column, and the cell renderers added to this column, to have their sizes renegotiated.

Since:
2.8

void setAlignment (float 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.

Params:
float xalign The alignment, which is between [0.0 and 1.0] inclusive.

void setCellDataFunc (CellRenderer cellRenderer, GtkTreeCellDataFunc func, void* funcData, 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.

Params:
CellRenderer cellRenderer A #GtkCellRenderer
GtkTreeCellDataFunc func The #GtkTreeCellDataFunc to use.
void* funcData The user data for @func.
GDestroyNotify destroy The destroy notification for @func_data

void setClickable (bool 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.

Params:
bool clickable %TRUE if the header is active.

void setExpand (bool 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.

Params:
bool expand %TRUE if the column should expand to fill available space.

Since:
2.4

void setFixedWidth (int fixedWidth);
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.

Params:
int fixedWidth The new fixed width, in pixels, or -1.

void setMaxWidth (int maxWidth);
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.

Params:
int maxWidth The maximum width of the column in pixels, or -1.

void setMinWidth (int minWidth);
Sets the minimum width of the @tree_column. If @min_width is -1, then the minimum width is unset.

Params:
int minWidth The minimum width of the column in pixels, or -1.

void setReorderable (bool reorderable);
If @reorderable is %TRUE, then the column can be reordered by the end user dragging the header.

Params:
bool reorderable %TRUE, if the column can be reordered.

void setResizable (bool 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 #GTK_TREE_VIEW_COLUMN_AUTOSIZE, then the sizing mode is changed to #GTK_TREE_VIEW_COLUMN_GROW_ONLY.

Params:
bool resizable %TRUE, if the column can be resized

void setSizing (GtkTreeViewColumnSizing type);
Sets the growth behavior of @tree_column to @type.

Params:
GtkTreeViewColumnSizing type The #GtkTreeViewColumnSizing.

void setSortColumnId (int sortColumnId);
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.

Params:
int sortColumnId The @sort_column_id of the model to sort on.

void setSortIndicator (bool 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.

Params:
bool setting %TRUE to display an indicator that the column is sorted

void setSortOrder (GtkSortType order);
Changes the appearance of the sort indicator.

This does not 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_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 gtk_tree_view_column_set_sort_indicator().

Params:
GtkSortType order sort order that the sort indicator should indicate

void setSpacing (int spacing);
Sets the spacing field of @tree_column, which is the number of pixels to place between cell renderers packed into it.

Params:
int spacing distance between cell renderers in pixels.

void setTitle (string title);
Sets the title of the @tree_column. If a custom widget has been set, then this value is ignored.

Params:
string title The title of the @tree_column.

void setVisible (bool visible);
Sets the visibility of @tree_column.

Params:
bool visible %TRUE if the @tree_column is visible.

void setWidget (Widget 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.

Params:
Widget widget A child #GtkWidget, or %NULL.

gulong addOnClicked (void delegate(TreeViewColumn) dlg, ConnectFlags connectFlags = cast(ConnectFlags)0);
Page was generated with on Sun Apr 23 22:52:57 2017