TreeViewColumn

Description 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 for an overview of all the objects and data types related to the tree widget and how they work together.

class TreeViewColumn : ObjectGtk , CellLayoutIF {}

Constructors

this
this(GtkTreeViewColumn* gtkTreeViewColumn)

Sets our main struct and passes it to the parent class

this
this(string header, CellRenderer renderer, string type, int column)

Creates a new Tree view column

this
this()

Creates a new GtkTreeViewColumn.

Members

Functions

addOnClicked
void addOnClicked(void delegate(TreeViewColumn) dlg, ConnectFlags connectFlags)

See Also GtkTreeView, GtkTreeSelection, GtkTreeDnd, GtkTreeMode, GtkTreeSortable, GtkTreeModelSort, GtkListStore, GtkTreeStore, GtkCellRenderer, GtkCellEditable, GtkCellRendererPixbuf, GtkCellRendererText, GtkCellRendererToggle

cellGetPosition
int cellGetPosition(CellRenderer cellRenderer, int startPos, 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.

cellGetSize
void cellGetSize(Rectangle cellArea, int xOffset, int yOffset, int width, int height)

Obtains the width and height needed to render the column. This is used primarily by the GtkTreeView.

cellIsVisible
int 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()

cellSetCellData
void cellSetCellData(TreeModelIF treeModel, TreeIter iter, int isExpander, int 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.

clicked
void clicked()

Emits the "clicked" signal on the column. This function will only work if tree_column is clickable.

focusCell
void focusCell(CellRenderer cell)

Sets the current keyboard focus to be at cell, if the column contains 2 or more editable and activatable cells. Since 2.2

getAlignment
float getAlignment()

Returns the current x alignment of tree_column. This value can range between 0.0 and 1.0.

getCellRenderers
ListG getCellRenderers()

Warning gtk_tree_view_column_get_cell_renderers has been deprecated since version 2.18 and should not be used in newly-written code. use gtk_cell_layout_get_cells() instead. Returns a newly-allocated GList of all the cell renderers in the column, in no particular order. The list must be freed with g_list_free().

getClickable
int getClickable()

Returns TRUE if the user can click on the header for the column.

getExpand
int getExpand()

Return TRUE if the column expands to take any available space. Since 2.4

getFixedWidth
int getFixedWidth()

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.

getMaxWidth
int getMaxWidth()

Returns the maximum width in pixels of the tree_column, or -1 if no maximum width is set.

getMinWidth
int getMinWidth()

Returns the minimum width in pixels of the tree_column, or -1 if no minimum width is set.

getReorderable
int getReorderable()

Returns TRUE if the tree_column can be reordered by the user.

getResizable
int getResizable()

Returns TRUE if the tree_column can be resized by the end user.

getSizing
GtkTreeViewColumnSizing getSizing()

Returns the current type of tree_column.

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

getSortIndicator
int getSortIndicator()

Gets the value set by gtk_tree_view_column_set_sort_indicator().

getSortOrder
GtkSortType getSortOrder()

Gets the value set by gtk_tree_view_column_set_sort_order().

getSpacing
int getSpacing()

Returns the spacing of tree_column.

getStruct
void* getStruct()

the main Gtk struct as a void*

getTitle
string getTitle()

Returns the title of the widget.

getTreeView
Widget 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

getTreeViewColumnStruct
GtkTreeViewColumn* getTreeViewColumnStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getVisible
int getVisible()

Returns TRUE if tree_column is visible.

getWidget
Widget getWidget()

Returns the GtkWidget in the button on the column header. If a custom widget has not been set then NULL is returned.

getWidth
int getWidth()

Returns the current size of tree_column in pixels.

queueResize
void queueResize()

Flags the column, and the cell renderers added to this column, to have their sizes renegotiated. Since 2.8

setAlignment
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.

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

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

setExpand
void setExpand(int 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. Since 2.4

setFixedWidth
void setFixedWidth(int fixedWidth)

Sets the size of the column in pixels. This is meaningful only if the sizing type is GTK_TREE_VIEW_COLUMN_FIXED. The size of the column is clamped to the min/max width for the column. Please note that the min/max width of the column doesn't actually affect the "fixed_width" property of the widget, just the actual size when displayed.

setMaxWidth
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.

setMinWidth
void setMinWidth(int minWidth)

Sets the minimum width of the tree_column. If min_width is -1, then the minimum width is unset.

setReorderable
void setReorderable(int reorderable)

If reorderable is TRUE, then the column can be reordered by the end user dragging the header.

setResizable
void setResizable(int 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.

setSizing
void setSizing(GtkTreeViewColumnSizing type)

Sets the growth behavior of tree_column to type.

setSortColumnId
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.

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

setSortOrder
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() 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().

setSpacing
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.

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
setTitle
void setTitle(string title)

Sets the title of the tree_column. If a custom widget has been set, then this value is ignored.

setVisible
void setVisible(int visible)

Sets the visibility of tree_column.

setWidget
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.

Mixins

__anonymous
mixin CellLayoutT!(GtkTreeViewColumn)
Undocumented in source.

Static functions

callBackClicked
void callBackClicked(GtkTreeViewColumn* treeviewcolumnStruct, TreeViewColumn _treeViewColumn)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

connectedSignals
int[string] connectedSignals;
gtkTreeViewColumn
GtkTreeViewColumn* gtkTreeViewColumn;

the main Gtk struct

onClickedListeners
void delegate(TreeViewColumn)[] onClickedListeners;
Undocumented in source.

Inherited Members

From ObjectGtk

gtkObject
GtkObject* gtkObject;

the main Gtk struct

getObjectGtkStruct
GtkObject* getObjectGtkStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
getId
string getId(StockID id)
connectedSignals
int[string] connectedSignals;
onDestroyListeners
void delegate(ObjectGtk)[] onDestroyListeners;
Undocumented in source.
addOnDestroy
void addOnDestroy(void delegate(ObjectGtk) dlg, ConnectFlags connectFlags)

Signals that all holders of a reference to the GtkObject should release the reference that they hold. May result in finalization of the object if all references are released. See Also GObject

callBackDestroy
void callBackDestroy(GtkObject* objectStruct, ObjectGtk _objectGtk)
Undocumented in source. Be warned that the author may not have intended to support it.
sink
void sink()

Warning gtk_object_sink has been deprecated since version 2.10 and should not be used in newly-written code. Use g_object_ref_sink() instead Removes the floating reference from a GtkObject, if it exists; otherwise does nothing. See the GtkObject overview documentation at the top of the page.

weakref
void weakref(GDestroyNotify notify, void* data)

Warning gtk_object_weakref is deprecated and should not be used in newly-written code. Use g_object_weak_ref() instead. Adds a weak reference callback to an object. Weak references are used for notification when an object is finalized. They are called "weak references" because they allow you to safely hold a pointer to an object without calling g_object_ref() (g_object_ref() adds a strong reference, that is, forces the object to stay alive).

weakunref
void weakunref(GDestroyNotify notify, void* data)

Warning gtk_object_weakunref is deprecated and should not be used in newly-written code. Use g_object_weak_unref() instead. Removes a weak reference callback to an object.

destroy
void destroy()

Warning gtk_object_destroy has been deprecated since version 2.24 and should not be used in newly-written code. Use gtk_widget_destroy() instead (if object is a widget) Emits the "destroy" signal notifying all reference holders that they should release the GtkObject. See the overview documentation at the top of the page for more details. The memory for the object itself won't be deleted until its reference count actually drops to 0; gtk_object_destroy() merely asks reference holders to release their references, it does not free the object.

removeNoNotify
void removeNoNotify(string key)

Warning gtk_object_remove_no_notify is deprecated and should not be used in newly-written code. Use g_object_steal_data() instead. Remove a specified datum from the object's data associations (the object_data), without invoking the association's destroy handler. Just like gtk_object_remove_data() except that any destroy handler will be ignored. Therefore this only affects data set using gtk_object_set_data_full().

setUserData
void setUserData(void* data)

Warning gtk_object_set_user_data is deprecated and should not be used in newly-written code. Use g_object_set_data() instead. For convenience, every object offers a generic user data pointer. This function sets it.

getUserData
void* getUserData()

Warning gtk_object_get_user_data is deprecated and should not be used in newly-written code. Use g_object_get_data() instead. Get the object's user data pointer. This is intended to be a pointer for your convenience in writing applications.

addArgType
void addArgType(string argName, GType argType, uint argFlags, uint argId)

Warning gtk_object_add_arg_type is deprecated and should not be used in newly-written code. Deprecated in favor of the GObject property system including GParamSpec. Add a new type of argument to an object class. Usually this is called when registering a new type of object.

setDataById
void setDataById(GQuark dataId, void* data)

Warning gtk_object_set_data_by_id is deprecated and should not be used in newly-written code. Use g_object_set_qdata() instead. Just like gtk_object_set_data() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

setDataByIdFull
void setDataByIdFull(GQuark dataId, void* data, GDestroyNotify destroy)

Warning gtk_object_set_data_by_id_full is deprecated and should not be used in newly-written code. Use g_object_set_qdata_full() instead. Just like gtk_object_set_data_full() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

getDataById
void* getDataById(GQuark dataId)

Warning gtk_object_get_data_by_id is deprecated and should not be used in newly-written code. Use g_object_get_qdata() instead. Just like gtk_object_get_data() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

removeDataById
void removeDataById(GQuark dataId)

Warning gtk_object_remove_data_by_id is deprecated and should not be used in newly-written code. Use g_object_set_qdata() with data of NULL instead. Just like gtk_object_remove_data() except that it takes a GQuark instead of a string, so it is slightly faster. Remove a specified datum from the object's data associations. Subsequent calls to gtk_object_get_data() will return NULL. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

removeNoNotifyById
void removeNoNotifyById(GQuark keyId)

Warning gtk_object_remove_no_notify_by_id is deprecated and should not be used in newly-written code. Use g_object_steal_qdata() instead. Just like gtk_object_remove_no_notify() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

From CellLayoutIF

getCellLayoutTStruct
GtkCellLayout* getCellLayoutTStruct()
Undocumented in source.
getStruct
void* getStruct()

the main Gtk struct as a void*

packStart
void packStart(CellRenderer cell, int expand)

Packs the cell into the beginning of cell_layout. 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. Note that reusing the same cell renderer is not supported. Since 2.4

packEnd
void packEnd(CellRenderer cell, int expand)

Adds the cell to the end of cell_layout. 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. Note that reusing the same cell renderer is not supported. Since 2.4

getCells
ListG getCells()

Returns the cell renderers which have been added to cell_layout. Since 2.12

reorder
void reorder(CellRenderer cell, int position)

Re-inserts cell at position. Note that cell has already to be packed into cell_layout for this to function properly. Since 2.4

clear
void clear()

Unsets all the mappings on all renderers on cell_layout and removes all renderers from cell_layout. Since 2.4

addAttribute
void addAttribute(CellRenderer cell, string attribute, int column)

Adds an attribute mapping to the list in cell_layout. The column is the column of the model to get a value from, and the attribute is the parameter on cell 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. Since 2.4

setCellDataFunc
void setCellDataFunc(CellRenderer cell, GtkCellLayoutDataFunc func, void* funcData, GDestroyNotify destroy)

Sets the GtkCellLayoutDataFunc to use for cell_layout. This function is used instead of the standard attributes mapping for setting the column value, and should set the value of cell_layout's cell renderer(s) as appropriate. func may be NULL to remove and older one. Since 2.4

clearAttributes
void clearAttributes(CellRenderer cell)

Clears all existing attributes previously set with gtk_cell_layout_set_attributes(). Since 2.4

Meta