gtkmm 4.16.0
Public Types | Public Member Functions | Static Public Member Functions | Related Symbols | List of all members
Gtk::TreeViewColumn Class Reference

Typedefed as Gtk::TreeView::Column. More...

#include <gtkmm/treeviewcolumn.h>

Inheritance diagram for Gtk::TreeViewColumn:
Inheritance graph
[legend]

Public Types

enum class  Sizing {
  GROW_ONLY ,
  AUTOSIZE ,
  FIXED
}
 
typedef TreeViewColumn Column
 
typedef sigc::slot< void(CellRenderer *, const Gtk::TreeModel::const_iterator &)> SlotTreeCellData
 For instance, void on_cell_data(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);.
 
- Public Types inherited from Gtk::CellLayout
typedef sigc::slot< void(const TreeModel::const_iterator &)> SlotCellData
 

Public Member Functions

 TreeViewColumn (TreeViewColumn &&src) noexcept
 
TreeViewColumnoperator= (TreeViewColumn &&src) noexcept
 
 TreeViewColumn (const TreeViewColumn &)=delete
 
TreeViewColumnoperator= (const TreeViewColumn &)=delete
 
 ~TreeViewColumn () noexcept override
 
GtkTreeViewColumngobj ()
 Provides access to the underlying C GObject.
 
const GtkTreeViewColumngobj () const
 Provides access to the underlying C GObject.
 
 TreeViewColumn ()
 
 TreeViewColumn (const Glib::ustring &title)
 
 TreeViewColumn (const Glib::ustring &title, CellRenderer &cell)
 
template<class T_ModelColumnType >
 TreeViewColumn (const Glib::ustring &title, const TreeModelColumn< T_ModelColumnType > &column)
 Create a default view column for the given model column type.
 
void pack_start (CellRenderer &cell, bool expand=true)
 Packs the cell into the beginning of the column.
 
void pack_end (CellRenderer &cell, bool expand=true)
 Adds the cell to end of the column.
 
template<class T_ModelColumnType >
void pack_start (const TreeModelColumn< T_ModelColumnType > &column, bool expand=true)
 Creates an appropriate CellRenderer for the column, and packs that cell into the beginning of the column.
 
template<class T_ModelColumnType >
void pack_end (const TreeModelColumn< T_ModelColumnType > &column, bool expand=true)
 Creates an appropriate CellRenderer for the column, and packs that cell at the end of the column.
 
void clear ()
 Unsets all the mappings on all renderers on the tree_column.
 
void add_attribute (CellRenderer &cell_renderer, const Glib::ustring &attribute, int column)
 Adds an attribute mapping to the list in tree_column.
 
void add_attribute (const Glib::PropertyProxy_Base &property, const TreeModelColumnBase &column)
 
void add_attribute (Gtk::CellRenderer &cell, const Glib::ustring & property_name, const TreeModelColumnBase &column)
 
void set_renderer (Gtk::CellRenderer &renderer, const TreeModelColumnBase &column)
 Associate a view CellRenderer with a model column, so that the CellRenderer renders the data in the model column.
 
void set_cell_data_func (CellRenderer &cell_renderer, const SlotTreeCellData &slot)
 Sets the slot callback to use for the column.
 
void unset_cell_data_func (CellRenderer &cell_renderer)
 Removes a previously set callback slot.
 
void clear_attributes (CellRenderer &cell_renderer)
 Clears all existing attributes previously set with set_attributes().
 
void set_spacing (int spacing)
 Sets the spacing field of tree_column, which is the number of pixels to place between cell renderers packed into it.
 
int get_spacing () const
 Returns the spacing of tree_column.
 
void set_visible (bool visible=true)
 Sets the visibility of tree_column.
 
bool get_visible () const
 Returns true if tree_column is visible.
 
void set_resizable (bool resizable=true)
 If resizable is true, then the user can explicitly resize the column by grabbing the outer edge of the column button.
 
bool get_resizable () const
 Returns true if the tree_column can be resized by the end user.
 
void set_sizing (Sizing type)
 Sets the growth behavior of tree_column to type.
 
Sizing get_sizing ()
 Returns the current type of tree_column.
 
int get_x_offset () const
 Returns the current X offset of tree_column in pixels.
 
int get_width () const
 Returns the current size of tree_column in pixels.
 
int get_fixed_width () const
 Gets the fixed width of the column.
 
void set_fixed_width (int fixed_width)
 If fixed_width is not -1, sets the fixed width of tree_column; otherwise unsets it.
 
void set_min_width (int min_width)
 Sets the minimum width of the tree_column.
 
int get_min_width () const
 Returns the minimum width in pixels of the tree_column, or -1 if no minimum width is set.
 
void set_max_width (int max_width)
 Sets the maximum width of the tree_column.
 
int get_max_width () const
 Returns the maximum width in pixels of the tree_column, or -1 if no maximum width is set.
 
void clicked ()
 Emits the “clicked” signal on the column.
 
void set_title (const Glib::ustring &title)
 Sets the title of the tree_column.
 
Glib::ustring get_title () const
 Returns the title of the widget.
 
void set_expand (bool expand=true)
 Sets the column to take available extra space.
 
bool get_expand () const
 Returns true if the column expands to fill available space.
 
void set_clickable (bool clickable=true)
 Sets the header to be active if clickable is true.
 
bool get_clickable () const
 Returns true if the user can click on the header for the column.
 
void set_widget (Gtk::Widget &widget)
 Sets the widget in the header to be widget.
 
Widgetget_widget ()
 Returns the Gtk::Widget in the button on the column header.
 
const Widgetget_widget () const
 Returns the Gtk::Widget in the button on the column header.
 
void set_alignment (float xalign)
 Sets the alignment of the title or custom widget inside the column header.
 
void set_alignment (Align xalign)
 Sets the alignment of the title or custom widget inside the column header.
 
float get_alignment () const
 Returns the current x alignment of tree_column.
 
void set_reorderable (bool reorderable=true)
 If reorderable is true, then the column can be reordered by the end user dragging the header.
 
bool get_reorderable () const
 Returns true if the tree_column can be reordered by the user.
 
void set_sort_column (const TreeModelColumnBase &sort_column_id)
 Sets the logical sort_column_id that this column sorts on when this column is selected for sorting.
 
void set_sort_column (int sort_column_id)
 Sets the logical sort_column_id that this column sorts on when this column is selected for sorting.
 
int get_sort_column_id () const
 Gets the logical sort_column_id that the model sorts on when this column is selected for sorting.
 
void set_sort_indicator (bool setting)
 Call this function with a setting of true to display an arrow in the header button indicating the column is sorted.
 
bool get_sort_indicator () const
 Gets the value set by set_sort_indicator().
 
void set_sort_order (SortType order)
 Changes the appearance of the sort indicator.
 
SortType get_sort_order () const
 Gets the value set by set_sort_order().
 
void cell_set_cell_data (const Glib::RefPtr< TreeModel > &tree_model, const TreeModel::iterator &iter, bool is_expander, bool is_expanded)
 Sets the cell renderer based on the tree_model and iter.
 
void cell_get_size (int &x_offset, int &y_offset, int & width, int &height) const
 Obtains the width and height needed to render the column.
 
bool cell_is_visible () const
 Returns true if any of the cells packed into the tree_column are visible.
 
void focus_cell (CellRenderer &cell)
 Sets the current keyboard focus to be at cell, if the column contains 2 or more editable and activatable cells.
 
bool get_cell_position (const CellRenderer &cell_renderer, int &start_pos, int & width) const
 Obtains the horizontal position and size of a cell in a column.
 
void queue_resize ()
 Flags the column, and the cell renderers added to this column, to have their sizes renegotiated.
 
TreeViewget_tree_view ()
 Returns the Gtk::TreeView wherein tree_column has been inserted.
 
const TreeViewget_tree_view () const
 Returns the Gtk::TreeView wherein tree_column has been inserted.
 
Buttonget_button ()
 Returns the button used in the treeview column header.
 
const Buttonget_button () const
 Returns the button used in the treeview column header.
 
Glib::SignalProxy< void()> signal_clicked ()
 
Glib::PropertyProxy< bool > property_visible ()
 Default value: true
 
Glib::PropertyProxy_ReadOnly< bool > property_visible () const
 Default value: true
 
Glib::PropertyProxy< bool > property_resizable ()
 Default value: false
 
Glib::PropertyProxy_ReadOnly< bool > property_resizable () const
 Default value: false
 
Glib::PropertyProxy_ReadOnly< int > property_x_offset () const
 Default value: 0.
 
Glib::PropertyProxy_ReadOnly< int > property_width () const
 Default value: 0.
 
Glib::PropertyProxy< int > property_spacing ()
 Default value: 0.
 
Glib::PropertyProxy_ReadOnly< int > property_spacing () const
 Default value: 0.
 
Glib::PropertyProxy< Sizingproperty_sizing ()
 Default value: Gtk::TreeViewColumn::Sizing::GROW_ONLY.
 
Glib::PropertyProxy_ReadOnly< Sizingproperty_sizing () const
 Default value: Gtk::TreeViewColumn::Sizing::GROW_ONLY.
 
Glib::PropertyProxy< int > property_fixed_width ()
 Default value: -1.
 
Glib::PropertyProxy_ReadOnly< int > property_fixed_width () const
 Default value: -1.
 
Glib::PropertyProxy< int > property_min_width ()
 Default value: -1.
 
Glib::PropertyProxy_ReadOnly< int > property_min_width () const
 Default value: -1.
 
Glib::PropertyProxy< int > property_max_width ()
 Default value: -1.
 
Glib::PropertyProxy_ReadOnly< int > property_max_width () const
 Default value: -1.
 
Glib::PropertyProxy< Glib::ustring > property_title ()
 Default value: "".
 
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_title () const
 Default value: "".
 
Glib::PropertyProxy< bool > property_expand ()
 Default value: false
 
Glib::PropertyProxy_ReadOnly< bool > property_expand () const
 Default value: false
 
Glib::PropertyProxy< bool > property_clickable ()
 Default value: false
 
Glib::PropertyProxy_ReadOnly< bool > property_clickable () const
 Default value: false
 
Glib::PropertyProxy< Widget * > property_widget ()
 
Glib::PropertyProxy_ReadOnly< Widget * > property_widget () const
 
Glib::PropertyProxy< floatproperty_alignment ()
 Default value: 0.
 
Glib::PropertyProxy_ReadOnly< floatproperty_alignment () const
 Default value: 0.
 
Glib::PropertyProxy< bool > property_reorderable ()
 Default value: false
 
Glib::PropertyProxy_ReadOnly< bool > property_reorderable () const
 Default value: false
 
Glib::PropertyProxy< bool > property_sort_indicator ()
 Default value: false
 
Glib::PropertyProxy_ReadOnly< bool > property_sort_indicator () const
 Default value: false
 
Glib::PropertyProxy< SortTypeproperty_sort_order ()
 Default value: Gtk::SortType::ASCENDING.
 
Glib::PropertyProxy_ReadOnly< SortTypeproperty_sort_order () const
 Default value: Gtk::SortType::ASCENDING.
 
Glib::PropertyProxy< int > property_sort_column_id ()
 Logical sort column ID this column sorts on when selected for sorting.
 
Glib::PropertyProxy_ReadOnly< int > property_sort_column_id () const
 Logical sort column ID this column sorts on when selected for sorting.
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< CellArea > > property_cell_area () const
 The Gtk::CellArea used to layout cell renderers for this column.
 
- Public Member Functions inherited from Gtk::Object
 Object (Object &&src) noexcept
 
Objectoperator= (Object &&src) noexcept
 
 ~Object () noexcept override
 
- Public Member Functions inherited from Gtk::CellLayout
 CellLayout (CellLayout &&src) noexcept
 
CellLayoutoperator= (CellLayout &&src) noexcept
 
 ~CellLayout () noexcept override
 
GtkCellLayoutgobj ()
 Provides access to the underlying C GObject.
 
const GtkCellLayoutgobj () const
 Provides access to the underlying C GObject.
 
template<class ColumnType >
void pack_start (const TreeModelColumn< ColumnType > &model_column, bool expand=true)
 
void pack_start (CellRenderer &cell, bool expand=true)
 Packs the cell into the beginning of cell_layout.
 
void pack_end (CellRenderer &cell, bool expand=true)
 Adds the cell to the end of cell_layout.
 
std::vector< CellRenderer * > get_cells ()
 Returns the cell renderers which have been added to cell_layout.
 
std::vector< const CellRenderer * > get_cells () const
 Returns the cell renderers which have been added to cell_layout.
 
CellRendererget_first_cell ()
 Gets the CellRenderer for the first column if any has been added, or nullptr otherwise.
 
const CellRendererget_first_cell () const
 Gets the CellRenderer for the first column if any has been added, or nullptr otherwise.
 
void clear ()
 Unsets all the mappings on all renderers on cell_layout and removes all renderers from cell_layout.
 
void add_attribute (CellRenderer &cell, const Glib::ustring &attribute, int column)
 Adds an attribute mapping to the list in cell_layout.
 
void add_attribute (const Glib::PropertyProxy_Base &property, const TreeModelColumnBase &column)
 
void add_attribute (CellRenderer &cell, const Glib::ustring &attribute, const TreeModelColumnBase &column)
 
void set_cell_data_func (CellRenderer &cell, const SlotCellData &slot)
 
void clear_attributes (CellRenderer &cell)
 Clears all existing attributes previously set with set_attributes().
 
void reorder (CellRenderer &cell, int position)
 Re-inserts cell at position.
 
Glib::RefPtr< CellAreaget_area ()
 Returns the underlying Gtk::CellArea which might be cell_layout if called on a Gtk::CellArea or might be nullptr if no Gtk::CellArea is used by cell_layout.
 
Glib::RefPtr< const CellAreaget_area () const
 Returns the underlying Gtk::CellArea which might be cell_layout if called on a Gtk::CellArea or might be nullptr if no Gtk::CellArea is used by cell_layout.
 
template<class T_ModelColumnType >
void pack_start (const TreeModelColumn< T_ModelColumnType > &column, bool expand)
 
- Public Member Functions inherited from Gtk::Buildable
 Buildable (Buildable &&src) noexcept
 
Buildableoperator= (Buildable &&src) noexcept
 
 ~Buildable () noexcept override
 
GtkBuildablegobj ()
 Provides access to the underlying C GObject.
 
const GtkBuildablegobj () const
 Provides access to the underlying C GObject.
 
Glib::ustring get_buildable_id () const
 Gets the ID of the buildable object.
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system.
 
- Static Public Member Functions inherited from Gtk::CellLayout
static void add_interface (GType gtype_implementer)
 
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system.
 
- Static Public Member Functions inherited from Gtk::Buildable
static void add_interface (GType gtype_implementer)
 
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system.
 

Related Symbols

(Note that these are not member symbols.)

Gtk::TreeViewColumnwrap (GtkTreeViewColumn *object, bool take_copy=false)
 A Glib::wrap() method for this object.
 

Additional Inherited Members

- Protected Member Functions inherited from Gtk::CellLayout
 CellLayout ()
 You should derive from this class to use it.
 
virtual void pack_start_vfunc (CellRenderer *cell, bool expand)
 
virtual void pack_end_vfunc (CellRenderer *cell, bool expand)
 
virtual void clear_vfunc ()
 
virtual void add_attribute_vfunc (CellRenderer *cell, const Glib::ustring &attribute, int column)
 
virtual void clear_attributes_vfunc (CellRenderer *cell)
 
virtual void reorder_vfunc (CellRenderer *cell, int position)
 
- Protected Member Functions inherited from Gtk::Buildable
 Buildable ()
 You should derive from this class to use it.
 

Detailed Description

Typedefed as Gtk::TreeView::Column.

This is a visible column in a Gtk::TreeView widget. It determines the geometry, type.

Deprecated:
4.10: Use Gtk::ColumnView and Gtk::ColumnViewColumn instead of Gtk::TreeView to show a tabular list.

Member Typedef Documentation

◆ Column

◆ SlotTreeCellData

For instance, void on_cell_data(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);.

This function is used instead of the standard attributes mapping for setting the column value, and should set the value of the column's cell renderer as appropriate.

Member Enumeration Documentation

◆ Sizing

Enumerator
GROW_ONLY 

Columns only get bigger in reaction to changes in the model.

AUTOSIZE 

Columns resize to be the optimal size every time the model changes.

FIXED 

Columns are a fixed numbers of pixels wide.

Constructor & Destructor Documentation

◆ TreeViewColumn() [1/6]

Gtk::TreeViewColumn::TreeViewColumn ( TreeViewColumn &&  src)
noexcept

◆ TreeViewColumn() [2/6]

Gtk::TreeViewColumn::TreeViewColumn ( const TreeViewColumn )
delete

◆ ~TreeViewColumn()

Gtk::TreeViewColumn::~TreeViewColumn ( )
overridenoexcept

◆ TreeViewColumn() [3/6]

Gtk::TreeViewColumn::TreeViewColumn ( )

◆ TreeViewColumn() [4/6]

Gtk::TreeViewColumn::TreeViewColumn ( const Glib::ustring &  title)
explicit

◆ TreeViewColumn() [5/6]

Gtk::TreeViewColumn::TreeViewColumn ( const Glib::ustring &  title,
CellRenderer cell 
)

◆ TreeViewColumn() [6/6]

template <class T_ModelColumnType >
Gtk::TreeViewColumn::TreeViewColumn ( const Glib::ustring &  title,
const TreeModelColumn< T_ModelColumnType > &  column 
)

Create a default view column for the given model column type.

Member Function Documentation

◆ add_attribute() [1/3]

void Gtk::TreeViewColumn::add_attribute ( CellRenderer cell_renderer,
const Glib::ustring &  attribute,
int  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 Gtk::CellRendererText get its values from column 2.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
cell_rendererThe Gtk::CellRenderer to set attributes on.
attributeAn attribute on the renderer.
columnThe column position on the model to get the attribute from.

◆ add_attribute() [2/3]

void Gtk::TreeViewColumn::add_attribute ( const Glib::PropertyProxy_Base &  property,
const TreeModelColumnBase column 
)

◆ add_attribute() [3/3]

void Gtk::TreeViewColumn::add_attribute ( Gtk::CellRenderer cell,
const Glib::ustring &  property_name,
const TreeModelColumnBase column 
)

◆ cell_get_size()

void Gtk::TreeViewColumn::cell_get_size ( int &  x_offset,
int &  y_offset,
int &  width,
int &  height 
) const

Obtains the width and height needed to render the column.

This is used primarily by the Gtk::TreeView.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
x_offsetLocation to return x offset of a cell relative to cell_area.
y_offsetLocation to return y offset of a cell relative to cell_area.
widthLocation to return width needed to render a cell.
heightLocation to return height needed to render a cell.

◆ cell_is_visible()

bool Gtk::TreeViewColumn::cell_is_visible ( ) const

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 cell_set_cell_data()

Deprecated: 4.10: Use GtkColumnView instead

Returns
true, if any of the cells packed into the tree_column are currently visible.

◆ cell_set_cell_data()

void Gtk::TreeViewColumn::cell_set_cell_data ( const Glib::RefPtr< TreeModel > &  tree_model,
const TreeModel::iterator iter,
bool  is_expander,
bool  is_expanded 
)

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 Gtk::TreeView.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
tree_modelThe Gtk::TreeModel to get the cell renderers attributes from.
iterThe Gtk::TreeIter to get the cell renderer’s attributes from.
is_expandertrue, if the row has children.
is_expandedtrue, if the row has visible children.

◆ clear()

void Gtk::TreeViewColumn::clear ( )

Unsets all the mappings on all renderers on the tree_column.

Deprecated: 4.10: Use GtkColumnView instead

◆ clear_attributes()

void Gtk::TreeViewColumn::clear_attributes ( CellRenderer cell_renderer)

Clears all existing attributes previously set with set_attributes().

Deprecated: 4.10: Use GtkColumnView instead

Parameters
cell_rendererA Gtk::CellRenderer to clear the attribute mapping on.

◆ clicked()

void Gtk::TreeViewColumn::clicked ( )

Emits the “clicked” signal on the column.

This function will only work if tree_column is clickable.

Deprecated: 4.10: Use GtkColumnView instead

◆ focus_cell()

void Gtk::TreeViewColumn::focus_cell ( CellRenderer cell)

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

Deprecated: 4.10: Use GtkColumnView instead

Parameters
cellA Gtk::CellRenderer.

◆ get_alignment()

float Gtk::TreeViewColumn::get_alignment ( ) const

Returns the current x alignment of tree_column.

This value can range between 0.0 and 1.0.

Deprecated: 4.10: Use GtkColumnView instead

Returns
The current alignent of tree_column.

◆ get_button() [1/2]

Button * Gtk::TreeViewColumn::get_button ( )

Returns the button used in the treeview column header.

Deprecated: 4.10: Use GtkColumnView instead

Returns
The button for the column header.

◆ get_button() [2/2]

const Button * Gtk::TreeViewColumn::get_button ( ) const

Returns the button used in the treeview column header.

Deprecated: 4.10: Use GtkColumnView instead

Returns
The button for the column header.

◆ get_cell_position()

bool Gtk::TreeViewColumn::get_cell_position ( const CellRenderer cell_renderer,
int &  start_pos,
int &  width 
) const

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.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
cell_rendererA Gtk::CellRenderer.
start_posReturn location for the horizontal position of cell within tree_column.
widthReturn location for the width of cell.
Returns
true if cell belongs to tree_column.

◆ get_clickable()

bool Gtk::TreeViewColumn::get_clickable ( ) const

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

Deprecated: 4.10: Use GtkColumnView instead

Returns
true if user can click the column header.

◆ get_expand()

bool Gtk::TreeViewColumn::get_expand ( ) const

Returns true if the column expands to fill available space.

Deprecated: 4.10: Use GtkColumnView instead

Returns
true if the column expands to fill available space.

◆ get_fixed_width()

int Gtk::TreeViewColumn::get_fixed_width ( ) const

Gets the fixed width of the column.

This may not be the actual displayed width of the column; for that, use get_width().

Deprecated: 4.10: Use GtkColumnView instead

Returns
The fixed width of the column.

◆ get_max_width()

int Gtk::TreeViewColumn::get_max_width ( ) const

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

Deprecated: 4.10: Use GtkColumnView instead

Returns
The maximum width of the tree_column.

◆ get_min_width()

int Gtk::TreeViewColumn::get_min_width ( ) const

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

Deprecated: 4.10: Use GtkColumnView instead

Returns
The minimum width of the tree_column.

◆ get_reorderable()

bool Gtk::TreeViewColumn::get_reorderable ( ) const

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

Deprecated: 4.10: Use GtkColumnView instead

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

◆ get_resizable()

bool Gtk::TreeViewColumn::get_resizable ( ) const

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

Deprecated: 4.10: Use GtkColumnView instead

Returns
true, if the tree_column can be resized.

◆ get_sizing()

Sizing Gtk::TreeViewColumn::get_sizing ( )

Returns the current type of tree_column.

Deprecated: 4.10: Use GtkColumnView instead

Returns
The type of tree_column.

◆ get_sort_column_id()

int Gtk::TreeViewColumn::get_sort_column_id ( ) const

Gets the logical sort_column_id that the model sorts on when this column is selected for sorting.

See set_sort_column_id().

Deprecated: 4.10: Use GtkColumnView instead

Returns
The current sort_column_id for this column, or -1 if this column can’t be used for sorting.

◆ get_sort_indicator()

bool Gtk::TreeViewColumn::get_sort_indicator ( ) const

Gets the value set by set_sort_indicator().

Deprecated: 4.10: Use GtkColumnView instead

Returns
Whether the sort indicator arrow is displayed.

◆ get_sort_order()

SortType Gtk::TreeViewColumn::get_sort_order ( ) const

Gets the value set by set_sort_order().

Deprecated: 4.10: Use GtkColumnView instead

Returns
The sort order the sort indicator is indicating.

◆ get_spacing()

int Gtk::TreeViewColumn::get_spacing ( ) const

Returns the spacing of tree_column.

Deprecated: 4.10: Use GtkColumnView instead

Returns
The spacing of tree_column.

◆ get_title()

Glib::ustring Gtk::TreeViewColumn::get_title ( ) const

Returns the title of the widget.

Deprecated: 4.10: Use GtkColumnView instead

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

◆ get_tree_view() [1/2]

TreeView * Gtk::TreeViewColumn::get_tree_view ( )

Returns the Gtk::TreeView wherein tree_column has been inserted.

If column is currently not inserted in any tree view, nullptr is returned.

Deprecated: 4.10: Use GtkColumnView instead

Returns
The tree view wherein column has been inserted.

◆ get_tree_view() [2/2]

const TreeView * Gtk::TreeViewColumn::get_tree_view ( ) const

Returns the Gtk::TreeView wherein tree_column has been inserted.

If column is currently not inserted in any tree view, nullptr is returned.

Deprecated: 4.10: Use GtkColumnView instead

Returns
The tree view wherein column has been inserted.

◆ get_type()

static GType Gtk::TreeViewColumn::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ get_visible()

bool Gtk::TreeViewColumn::get_visible ( ) const

Returns true if tree_column is visible.

Deprecated: 4.10: Use GtkColumnView instead

Returns
Whether the column is visible or not. If it is visible, then the tree will show the column.

◆ get_widget() [1/2]

Widget * Gtk::TreeViewColumn::get_widget ( )

Returns the Gtk::Widget in the button on the column header.

If a custom widget has not been set then nullptr is returned.

Deprecated: 4.10: Use GtkColumnView instead

Returns
The Gtk::Widget in the column header.

◆ get_widget() [2/2]

const Widget * Gtk::TreeViewColumn::get_widget ( ) const

Returns the Gtk::Widget in the button on the column header.

If a custom widget has not been set then nullptr is returned.

Deprecated: 4.10: Use GtkColumnView instead

Returns
The Gtk::Widget in the column header.

◆ get_width()

int Gtk::TreeViewColumn::get_width ( ) const

Returns the current size of tree_column in pixels.

Deprecated: 4.10: Use GtkColumnView instead

Returns
The current width of tree_column.

◆ get_x_offset()

int Gtk::TreeViewColumn::get_x_offset ( ) const

Returns the current X offset of tree_column in pixels.

Deprecated: 4.10: Use GtkColumnView instead

Returns
The current X offset of tree_column.

◆ gobj() [1/2]

GtkTreeViewColumn * Gtk::TreeViewColumn::gobj ( )
inline

Provides access to the underlying C GObject.

◆ gobj() [2/2]

const GtkTreeViewColumn * Gtk::TreeViewColumn::gobj ( ) const
inline

Provides access to the underlying C GObject.

◆ operator=() [1/2]

TreeViewColumn & Gtk::TreeViewColumn::operator= ( const TreeViewColumn )
delete

◆ operator=() [2/2]

TreeViewColumn & Gtk::TreeViewColumn::operator= ( TreeViewColumn &&  src)
noexcept

◆ pack_end() [1/2]

void Gtk::TreeViewColumn::pack_end ( CellRenderer cell,
bool  expand = true 
)

Adds the cell to end of the column.

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.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
cellThe Gtk::CellRenderer.
expandtrue if cell is to be given extra space allocated to tree_column.

◆ pack_end() [2/2]

template <class T_ModelColumnType >
void Gtk::TreeViewColumn::pack_end ( const TreeModelColumn< T_ModelColumnType > &  column,
bool  expand = true 
)

Creates an appropriate CellRenderer for the column, and packs that cell at the end of the column.

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.

You can use get_first_cell() or get_cells() to access the generated CellRenderer.

Parameters
columnThe model column that will be rendered by the view cell.
expandtrue if the cell is to be given extra space allocated to the view column.

◆ pack_start() [1/2]

void Gtk::TreeViewColumn::pack_start ( CellRenderer cell,
bool  expand = true 
)

Packs the cell into the beginning of the column.

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.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
cellThe Gtk::CellRenderer.
expandtrue if cell is to be given extra space allocated to tree_column.

◆ pack_start() [2/2]

template <class T_ModelColumnType >
void Gtk::TreeViewColumn::pack_start ( const TreeModelColumn< T_ModelColumnType > &  column,
bool  expand = true 
)

Creates an appropriate CellRenderer for the column, and packs that cell into the beginning of the column.

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.

You can use get_first_cell() or get_cells() to access the generated CellRenderer.

Parameters
columnThe model column that will be rendered by the view cell.
expandtrue if the cell is to be given extra space allocated to the view column.

◆ property_alignment() [1/2]

Glib::PropertyProxy< float > Gtk::TreeViewColumn::property_alignment ( )

Default value: 0.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_alignment() [2/2]

Glib::PropertyProxy_ReadOnly< float > Gtk::TreeViewColumn::property_alignment ( ) const

Default value: 0.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_cell_area()

Glib::PropertyProxy_ReadOnly< Glib::RefPtr< CellArea > > Gtk::TreeViewColumn::property_cell_area ( ) const

The Gtk::CellArea used to layout cell renderers for this column.

If no area is specified when creating the tree view column with Gtk::TreeViewColumn::new_with_area() a horizontally oriented Gtk::CellAreaBox will be used.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_clickable() [1/2]

Glib::PropertyProxy< bool > Gtk::TreeViewColumn::property_clickable ( )

Default value: false

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_clickable() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeViewColumn::property_clickable ( ) const

Default value: false

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_expand() [1/2]

Glib::PropertyProxy< bool > Gtk::TreeViewColumn::property_expand ( )

Default value: false

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_expand() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeViewColumn::property_expand ( ) const

Default value: false

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_fixed_width() [1/2]

Glib::PropertyProxy< int > Gtk::TreeViewColumn::property_fixed_width ( )

Default value: -1.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_fixed_width() [2/2]

Glib::PropertyProxy_ReadOnly< int > Gtk::TreeViewColumn::property_fixed_width ( ) const

Default value: -1.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_max_width() [1/2]

Glib::PropertyProxy< int > Gtk::TreeViewColumn::property_max_width ( )

Default value: -1.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_max_width() [2/2]

Glib::PropertyProxy_ReadOnly< int > Gtk::TreeViewColumn::property_max_width ( ) const

Default value: -1.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_min_width() [1/2]

Glib::PropertyProxy< int > Gtk::TreeViewColumn::property_min_width ( )

Default value: -1.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_min_width() [2/2]

Glib::PropertyProxy_ReadOnly< int > Gtk::TreeViewColumn::property_min_width ( ) const

Default value: -1.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_reorderable() [1/2]

Glib::PropertyProxy< bool > Gtk::TreeViewColumn::property_reorderable ( )

Default value: false

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_reorderable() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeViewColumn::property_reorderable ( ) const

Default value: false

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_resizable() [1/2]

Glib::PropertyProxy< bool > Gtk::TreeViewColumn::property_resizable ( )

Default value: false

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_resizable() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeViewColumn::property_resizable ( ) const

Default value: false

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_sizing() [1/2]

Glib::PropertyProxy< Sizing > Gtk::TreeViewColumn::property_sizing ( )

Default value: Gtk::TreeViewColumn::Sizing::GROW_ONLY.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_sizing() [2/2]

Glib::PropertyProxy_ReadOnly< Sizing > Gtk::TreeViewColumn::property_sizing ( ) const

Default value: Gtk::TreeViewColumn::Sizing::GROW_ONLY.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_sort_column_id() [1/2]

Glib::PropertyProxy< int > Gtk::TreeViewColumn::property_sort_column_id ( )

Logical sort column ID this column sorts on when selected for sorting.

Setting the sort column ID makes the column header clickable. Set to -1 to make the column unsortable.

Default value: -1

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_sort_column_id() [2/2]

Glib::PropertyProxy_ReadOnly< int > Gtk::TreeViewColumn::property_sort_column_id ( ) const

Logical sort column ID this column sorts on when selected for sorting.

Setting the sort column ID makes the column header clickable. Set to -1 to make the column unsortable.

Default value: -1

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_sort_indicator() [1/2]

Glib::PropertyProxy< bool > Gtk::TreeViewColumn::property_sort_indicator ( )

Default value: false

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_sort_indicator() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeViewColumn::property_sort_indicator ( ) const

Default value: false

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_sort_order() [1/2]

Glib::PropertyProxy< SortType > Gtk::TreeViewColumn::property_sort_order ( )

Default value: Gtk::SortType::ASCENDING.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_sort_order() [2/2]

Glib::PropertyProxy_ReadOnly< SortType > Gtk::TreeViewColumn::property_sort_order ( ) const

Default value: Gtk::SortType::ASCENDING.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_spacing() [1/2]

Glib::PropertyProxy< int > Gtk::TreeViewColumn::property_spacing ( )

Default value: 0.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_spacing() [2/2]

Glib::PropertyProxy_ReadOnly< int > Gtk::TreeViewColumn::property_spacing ( ) const

Default value: 0.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_title() [1/2]

Glib::PropertyProxy< Glib::ustring > Gtk::TreeViewColumn::property_title ( )

Default value: "".

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_title() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::TreeViewColumn::property_title ( ) const

Default value: "".

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_visible() [1/2]

Glib::PropertyProxy< bool > Gtk::TreeViewColumn::property_visible ( )

Default value: true

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_visible() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeViewColumn::property_visible ( ) const

Default value: true

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_widget() [1/2]

Glib::PropertyProxy< Widget * > Gtk::TreeViewColumn::property_widget ( )
Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_widget() [2/2]

Glib::PropertyProxy_ReadOnly< Widget * > Gtk::TreeViewColumn::property_widget ( ) const
Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_width()

Glib::PropertyProxy_ReadOnly< int > Gtk::TreeViewColumn::property_width ( ) const

Default value: 0.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_x_offset()

Glib::PropertyProxy_ReadOnly< int > Gtk::TreeViewColumn::property_x_offset ( ) const

Default value: 0.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ queue_resize()

void Gtk::TreeViewColumn::queue_resize ( )

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

Deprecated: 4.10: Use GtkColumnView instead

◆ set_alignment() [1/2]

void Gtk::TreeViewColumn::set_alignment ( Align  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.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
xalignThe alignment, which is between [0.0 and 1.0] inclusive.

◆ set_alignment() [2/2]

void Gtk::TreeViewColumn::set_alignment ( 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.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
xalignThe alignment, which is between [0.0 and 1.0] inclusive.

◆ set_cell_data_func()

void Gtk::TreeViewColumn::set_cell_data_func ( CellRenderer cell_renderer,
const SlotTreeCellData slot 
)

Sets the slot callback to use for the column.

This callback function is used instead of the standard attributes mapping for setting the column value, and should set the value of the column's cell renderer as appropriate.

See also unset_cell_data_func().

Parameters
cell_rendererA Gtk::CellRenderer
slotThe callback slot to use. Create this with sigc::mem_fun(), or sigc::ptr_fun().

◆ set_clickable()

void Gtk::TreeViewColumn::set_clickable ( bool  clickable = true)

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.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
clickabletrue if the header is active.

◆ set_expand()

void Gtk::TreeViewColumn::set_expand ( bool  expand = true)

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.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
expandtrue if the column should expand to fill available space.

◆ set_fixed_width()

void Gtk::TreeViewColumn::set_fixed_width ( int  fixed_width)

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::TreeViewColumn::Sizing::GROW_ONLY or Gtk::TreeViewColumn::Sizing::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.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
fixed_widthThe new fixed width, in pixels, or -1.

◆ set_max_width()

void Gtk::TreeViewColumn::set_max_width ( int  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 any extra space.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
max_widthThe maximum width of the column in pixels, or -1.

◆ set_min_width()

void Gtk::TreeViewColumn::set_min_width ( int  min_width)

Sets the minimum width of the tree_column.

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

Deprecated: 4.10: Use GtkColumnView instead

Parameters
min_widthThe minimum width of the column in pixels, or -1.

◆ set_renderer()

void Gtk::TreeViewColumn::set_renderer ( Gtk::CellRenderer renderer,
const TreeModelColumnBase column 
)

Associate a view CellRenderer with a model column, so that the CellRenderer renders the data in the model column.

Parameters
rendererThe view cell renderer which will render the model column.
columnThe model column to be renderered by this view.

◆ set_reorderable()

void Gtk::TreeViewColumn::set_reorderable ( bool  reorderable = true)

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

Deprecated: 4.10: Use GtkColumnView instead

Parameters
reorderabletrue, if the column can be reordered.

◆ set_resizable()

void Gtk::TreeViewColumn::set_resizable ( bool  resizable = true)

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::TreeViewColumn::Sizing::AUTOSIZE, then the sizing mode is changed to Gtk::TreeViewColumn::Sizing::GROW_ONLY.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
resizabletrue, if the column can be resized.

◆ set_sizing()

void Gtk::TreeViewColumn::set_sizing ( Sizing  type)

Sets the growth behavior of tree_column to type.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
typeThe Gtk::TreeViewColumnSizing.

◆ set_sort_column() [1/2]

void Gtk::TreeViewColumn::set_sort_column ( const TreeModelColumnBase 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.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
sort_column_idThe sort_column_id of the model to sort on.

◆ set_sort_column() [2/2]

void Gtk::TreeViewColumn::set_sort_column ( int  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.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
sort_column_idThe sort_column_id of the model to sort on.

◆ set_sort_indicator()

void Gtk::TreeViewColumn::set_sort_indicator ( bool  setting)

Call this function with a setting of true to display an arrow in the header button indicating the column is sorted.

Call set_sort_order() to change the direction of the arrow.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
settingtrue to display an indicator that the column is sorted.

◆ set_sort_order()

void Gtk::TreeViewColumn::set_sort_order ( SortType  order)

Changes the appearance of the sort indicator.

This does not actually sort the model. Use 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::TreeSortable::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 set_sort_indicator().

Deprecated: 4.10: Use GtkColumnView instead

Parameters
orderSort order that the sort indicator should indicate.

◆ set_spacing()

void Gtk::TreeViewColumn::set_spacing ( int  spacing)

Sets the spacing field of tree_column, which is the number of pixels to place between cell renderers packed into it.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
spacingDistance between cell renderers in pixels.

◆ set_title()

void Gtk::TreeViewColumn::set_title ( const Glib::ustring &  title)

Sets the title of the tree_column.

If a custom widget has been set, then this value is ignored.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
titleThe title of the tree_column.

◆ set_visible()

void Gtk::TreeViewColumn::set_visible ( bool  visible = true)

Sets the visibility of tree_column.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
visibletrue if the tree_column is visible.

◆ set_widget()

void Gtk::TreeViewColumn::set_widget ( Gtk::Widget widget)

Sets the widget in the header to be widget.

If widget is nullptr, then the header button is set with a Gtk::Label set to the title of tree_column.

Deprecated: 4.10: Use GtkColumnView instead

Parameters
widgetA child Gtk::Widget.

◆ signal_clicked()

Glib::SignalProxy< void()> Gtk::TreeViewColumn::signal_clicked ( )
Slot Prototype:
void on_my_clicked()

Flags: Run Last

Emitted when the column's header has been clicked.

◆ unset_cell_data_func()

void Gtk::TreeViewColumn::unset_cell_data_func ( CellRenderer cell_renderer)

Removes a previously set callback slot.

See set_cell_data_func().

Friends And Related Symbol Documentation

◆ wrap()

Gtk::TreeViewColumn * wrap ( GtkTreeViewColumn object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.