gtkmm: Gtk::TreeViewColumn Class Reference
Typedefed as Gtk::TreeView::Column. More...
#include <gtkmm/treeviewcolumn.h>
Public Types | |
enum | Sizing { Sizing::GROW_ONLY, Sizing::AUTOSIZE, Sizing::FIXED } |
The sizing method the column uses to determine its width. More... | |
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);. More... | |
Public Types inherited from Glib::Object | |
typedef void(*)(gpointer data | DestroyNotify) |
Public Types inherited from sigc::trackable | |
typedef internal::func_destroy_notify | func_destroy_notify |
Public Types inherited from sigc::notifiable | |
typedef internal::func_destroy_notify | func_destroy_notify |
Public Types inherited from Gtk::CellLayout | |
typedef sigc::slot< void(const TreeModel::const_iterator&)> | SlotCellData |
Public Member Functions | |
TreeViewColumn (TreeViewColumn&& src) noexcept | |
TreeViewColumn& | operator= (TreeViewColumn&& src) noexcept |
TreeViewColumn (const TreeViewColumn&)=delete | |
TreeViewColumn& | operator= (const TreeViewColumn&)=delete |
~TreeViewColumn () noexcept override | |
GtkTreeViewColumn* | gobj () |
Provides access to the underlying C GObject. More... | |
const GtkTreeViewColumn* | gobj () const |
Provides access to the underlying C GObject. More... | |
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. More... | |
void | pack_start (CellRenderer& cell, bool expand=true) |
Packs the cell into the beginning of the column. More... | |
void | pack_end (CellRenderer& cell, bool expand=true) |
Adds the cell to end of the column. More... | |
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. More... | |
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. More... | |
void | clear () |
Unsets all the mappings on all renderers on the tree_column. More... | |
void | add_attribute (CellRenderer& cell_renderer, const Glib::ustring& attribute, int column) |
Adds an attribute mapping to the list in tree_column. More... | |
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. More... | |
void | set_cell_data_func (CellRenderer& cell_renderer, const SlotTreeCellData& slot) |
Sets the slot callback to use for the column. More... | |
void | unset_cell_data_func (CellRenderer& cell_renderer) |
Removes a previously set callback slot. More... | |
void | clear_attributes (CellRenderer& cell_renderer) |
Clears all existing attributes previously set with set_attributes(). More... | |
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. More... | |
int | get_spacing () const |
Returns the spacing of tree_column. More... | |
void | set_visible (bool visible=true) |
Sets the visibility of tree_column. More... | |
bool | get_visible () const |
Returns true if tree_column is visible. More... | |
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. More... | |
bool | get_resizable () const |
Returns true if the tree_column can be resized by the end user. More... | |
void | set_sizing (Sizing type) |
Sets the growth behavior of tree_column to type. More... | |
Sizing | get_sizing () |
Returns the current type of tree_column. More... | |
int | get_x_offset () const |
Returns the current X offset of tree_column in pixels. More... | |
int | get_width () const |
Returns the current size of tree_column in pixels. More... | |
int | get_fixed_width () const |
Gets the fixed width of the column. More... | |
void | set_fixed_width (int fixed_width) |
If fixed_width is not -1, sets the fixed width of tree_column; otherwise unsets it. More... | |
void | set_min_width (int min_width) |
Sets the minimum width of the tree_column. More... | |
int | get_min_width () const |
Returns the minimum width in pixels of the tree_column, or -1 if no minimum width is set. More... | |
void | set_max_width (int max_width) |
Sets the maximum width of the tree_column. More... | |
int | get_max_width () const |
Returns the maximum width in pixels of the tree_column, or -1 if no maximum width is set. More... | |
void | clicked () |
Emits the “clicked” signal on the column. More... | |
void | set_title (const Glib::ustring& title) |
Sets the title of the tree_column. More... | |
Glib::ustring | get_title () const |
Returns the title of the widget. More... | |
void | set_expand (bool expand=true) |
Sets the column to take available extra space. More... | |
bool | get_expand () const |
Returns true if the column expands to fill available space. More... | |
void | set_clickable (bool clickable=true) |
Sets the header to be active if clickable is true . More... | |
bool | get_clickable () const |
Returns true if the user can click on the header for the column. More... | |
void | set_widget (Gtk::Widget& widget) |
Sets the widget in the header to be widget. More... | |
Widget* | get_widget () |
Returns the Gtk::Widget in the button on the column header. More... | |
const Widget* | get_widget () const |
Returns the Gtk::Widget in the button on the column header. More... | |
void | set_alignment (float xalign) |
Sets the alignment of the title or custom widget inside the column header. More... | |
void | set_alignment (Align xalign) |
Sets the alignment of the title or custom widget inside the column header. More... | |
float | get_alignment () const |
Returns the current x alignment of tree_column. More... | |
void | set_reorderable (bool reorderable=true) |
If reorderable is true , then the column can be reordered by the end user dragging the header. More... | |
bool | get_reorderable () const |
Returns true if the tree_column can be reordered by the user. More... | |
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. More... | |
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. More... | |
int | get_sort_column_id () const |
Gets the logical sort_column_id that the model sorts on when this column is selected for sorting. More... | |
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. More... | |
bool | get_sort_indicator () const |
Gets the value set by set_sort_indicator(). More... | |
void | set_sort_order (SortType order) |
Changes the appearance of the sort indicator. More... | |
SortType | get_sort_order () const |
Gets the value set by set_sort_order(). More... | |
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. More... | |
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. More... | |
bool | cell_is_visible () const |
Returns true if any of the cells packed into the tree_column are visible. More... | |
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. More... | |
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. More... | |
void | queue_resize () |
Flags the column, and the cell renderers added to this column, to have their sizes renegotiated. More... | |
TreeView* | get_tree_view () |
Returns the Gtk::TreeView wherein tree_column has been inserted. More... | |
const TreeView* | get_tree_view () const |
Returns the Gtk::TreeView wherein tree_column has been inserted. More... | |
Button* | get_button () |
Returns the button used in the treeview column header. More... | |
const Button* | get_button () const |
Returns the button used in the treeview column header. More... | |
Glib::SignalProxy< void()> | signal_clicked () |
Glib::PropertyProxy< bool > | property_visible () |
Whether to display the column. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_visible () const |
Whether to display the column. More... | |
Glib::PropertyProxy< bool > | property_resizable () |
Column is user-resizable. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_resizable () const |
Column is user-resizable. More... | |
Glib::PropertyProxy_ReadOnly< int > | property_x_offset () const |
Current X position of the column. More... | |
Glib::PropertyProxy_ReadOnly< int > | property_width () const |
Current width of the column. More... | |
Glib::PropertyProxy< int > | property_spacing () |
Space which is inserted between cells. More... | |
Glib::PropertyProxy_ReadOnly< int > | property_spacing () const |
Space which is inserted between cells. More... | |
Glib::PropertyProxy< Sizing > | property_sizing () |
Resize mode of the column. More... | |
Glib::PropertyProxy_ReadOnly< Sizing > | property_sizing () const |
Resize mode of the column. More... | |
Glib::PropertyProxy< int > | property_fixed_width () |
Current fixed width of the column. More... | |
Glib::PropertyProxy_ReadOnly< int > | property_fixed_width () const |
Current fixed width of the column. More... | |
Glib::PropertyProxy< int > | property_min_width () |
Minimum allowed width of the column. More... | |
Glib::PropertyProxy_ReadOnly< int > | property_min_width () const |
Minimum allowed width of the column. More... | |
Glib::PropertyProxy< int > | property_max_width () |
Maximum allowed width of the column. More... | |
Glib::PropertyProxy_ReadOnly< int > | property_max_width () const |
Maximum allowed width of the column. More... | |
Glib::PropertyProxy< Glib::ustring > | property_title () |
Title to appear in column header. More... | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_title () const |
Title to appear in column header. More... | |
Glib::PropertyProxy< bool > | property_expand () |
Column gets share of extra width allocated to the widget. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_expand () const |
Column gets share of extra width allocated to the widget. More... | |
Glib::PropertyProxy< bool > | property_clickable () |
Whether the header can be clicked. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_clickable () const |
Whether the header can be clicked. More... | |
Glib::PropertyProxy< Widget* > | property_widget () |
Widget to put in column header button instead of column title. More... | |
Glib::PropertyProxy_ReadOnly< Widget* > | property_widget () const |
Widget to put in column header button instead of column title. More... | |
Glib::PropertyProxy< float > | property_alignment () |
X Alignment of the column header text or widget. More... | |
Glib::PropertyProxy_ReadOnly< float > | property_alignment () const |
X Alignment of the column header text or widget. More... | |
Glib::PropertyProxy< bool > | property_reorderable () |
Whether the column can be reordered around the headers. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_reorderable () const |
Whether the column can be reordered around the headers. More... | |
Glib::PropertyProxy< bool > | property_sort_indicator () |
Whether to show a sort indicator. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_sort_indicator () const |
Whether to show a sort indicator. More... | |
Glib::PropertyProxy< SortType > | property_sort_order () |
Sort direction the sort indicator should indicate. More... | |
Glib::PropertyProxy_ReadOnly< SortType > | property_sort_order () const |
Sort direction the sort indicator should indicate. More... | |
Glib::PropertyProxy< int > | property_sort_column_id () |
Logical sort column ID this column sorts on when selected for sorting. More... | |
Glib::PropertyProxy_ReadOnly< int > | property_sort_column_id () const |
Logical sort column ID this column sorts on when selected for sorting. More... | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< CellArea > > | property_cell_area () const |
The Gtk::CellArea used to layout cell renderers for this column. More... | |
Public Member Functions inherited from Gtk::Object | |
Object (Object&& src) noexcept | |
Object& | operator= (Object&& src) noexcept |
~Object () noexcept override | |
Public Member Functions inherited from Glib::Object | |
Object (const Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&src) noexcept | |
Object & | operator= (Object &&src) noexcept |
void * | get_data (const QueryQuark &key) |
void | set_data (const Quark &key, void *data) |
void | set_data (const Quark &key, void *data, DestroyNotify notify) |
void | remove_data (const QueryQuark &quark) |
void * | steal_data (const QueryQuark &quark) |
Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false) |
Public Member Functions inherited from Glib::ObjectBase | |
ObjectBase (const ObjectBase &)=delete | |
ObjectBase & | operator= (const ObjectBase &)=delete |
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value) |
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const |
void | set_property (const Glib::ustring &property_name, const PropertyType &value) |
void | get_property (const Glib::ustring &property_name, PropertyType &value) const |
PropertyType | get_property (const Glib::ustring &property_name) const |
sigc::connection | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void()> &slot) |
sigc::connection | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void()> &&slot) |
void | freeze_notify () |
void | thaw_notify () |
virtual void | reference () const |
virtual void | unreference () const |
GObject * | gobj () |
const GObject * | gobj () const |
GObject * | gobj_copy () const |
Public Member Functions inherited from sigc::trackable | |
trackable () noexcept | |
trackable (const trackable &src) noexcept | |
trackable (trackable &&src) noexcept | |
~trackable () | |
void | add_destroy_notify_callback (notifiable *data, func_destroy_notify func) const |
void | notify_callbacks () |
trackable & | operator= (const trackable &src) |
trackable & | operator= (trackable &&src) noexcept |
void | remove_destroy_notify_callback (notifiable *data) const |
Public Member Functions inherited from Gtk::CellLayout | |
CellLayout (CellLayout&& src) noexcept | |
CellLayout& | operator= (CellLayout&& src) noexcept |
~CellLayout () noexcept override | |
GtkCellLayout* | gobj () |
Provides access to the underlying C GObject. More... | |
const GtkCellLayout* | gobj () const |
Provides access to the underlying C GObject. More... | |
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. More... | |
void | pack_end (CellRenderer& cell, bool expand=true) |
Adds the cell to the end of cell_layout. More... | |
std::vector< CellRenderer* > | get_cells () |
Returns the cell renderers which have been added to cell_layout. More... | |
std::vector< const CellRenderer* > | get_cells () const |
Returns the cell renderers which have been added to cell_layout. More... | |
CellRenderer* | get_first_cell () |
Gets the CellRenderer for the first column if any has been added, or nullptr otherwise. More... | |
const CellRenderer* | get_first_cell () const |
Gets the CellRenderer for the first column if any has been added, or nullptr otherwise. More... | |
void | clear () |
Unsets all the mappings on all renderers on cell_layout and removes all renderers from cell_layout. More... | |
void | add_attribute (CellRenderer& cell, const Glib::ustring& attribute, int column) |
Adds an attribute mapping to the list in cell_layout. More... | |
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(). More... | |
void | reorder (CellRenderer& cell, int position) |
Re-inserts cell at position. More... | |
Glib::RefPtr< CellArea > | get_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. More... | |
Glib::RefPtr< const CellArea > | get_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. More... | |
template<class T_ModelColumnType > | |
void | pack_start (const TreeModelColumn< T_ModelColumnType >& column, bool expand) |
Public Member Functions inherited from Glib::Interface | |
Interface () | |
Interface (Interface &&src) noexcept | |
Interface & | operator= (Interface &&src) noexcept |
Interface (const Glib::Interface_Class &interface_class) | |
Interface (GObject *castitem) | |
~Interface () noexcept override | |
Interface (const Interface &)=delete | |
Interface & | operator= (const Interface &)=delete |
GObject * | gobj () |
const GObject * | gobj () const |
Public Member Functions inherited from Gtk::Buildable | |
Buildable (Buildable&& src) noexcept | |
Buildable& | operator= (Buildable&& src) noexcept |
~Buildable () noexcept override | |
GtkBuildable* | gobj () |
Provides access to the underlying C GObject. More... | |
const GtkBuildable* | gobj () const |
Provides access to the underlying C GObject. More... | |
Glib::ustring | get_buildable_id () const |
Gets the ID of the buildable object. More... | |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
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. More... | |
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. More... | |
Related Functions | |
(Note that these are not member functions.) | |
Gtk::TreeViewColumn* | wrap (GtkTreeViewColumn* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
Related Functions inherited from Gtk::CellLayout | |
Glib::RefPtr< Gtk::CellLayout > | wrap (GtkCellLayout* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
Related Functions inherited from Gtk::Buildable | |
Glib::RefPtr< Gtk::Buildable > | wrap (GtkBuildable* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Glib::Object | |
Object () | |
Object (const Glib::ConstructParams &construct_params) | |
Object (GObject *castitem) | |
~Object () noexcept override | |
Protected Member Functions inherited from Glib::ObjectBase | |
ObjectBase () | |
ObjectBase (const char *custom_type_name) | |
ObjectBase (const std::type_info &custom_type_info) | |
ObjectBase (ObjectBase &&src) noexcept | |
ObjectBase & | operator= (ObjectBase &&src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject *castitem) |
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) |
Protected Member Functions inherited from Gtk::CellLayout | |
CellLayout () | |
You should derive from this class to use it. More... | |
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. More... | |
Detailed Description
Typedefed as Gtk::TreeView::Column.
This is a visible column in a Gtk::TreeView widget. It determines the geometry, type.
Member Typedef Documentation
typedef sigc::slot<void(CellRenderer*, const Gtk::TreeModel::const_iterator&)> Gtk::TreeViewColumn::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.
Constructor & Destructor Documentation
|
noexcept |
|
delete |
|
overridenoexcept |
Gtk::TreeViewColumn::TreeViewColumn | ( | ) |
|
explicit |
Gtk::TreeViewColumn::TreeViewColumn | ( | const Glib::ustring & | title, |
CellRenderer& | cell | ||
) |
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
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.
- Parameters
-
cell_renderer The Gtk::CellRenderer to set attributes on. attribute An attribute on the renderer. column The column position on the model to get the attribute from.
void Gtk::TreeViewColumn::add_attribute | ( | const Glib::PropertyProxy_Base & | property, |
const TreeModelColumnBase& | column | ||
) |
void Gtk::TreeViewColumn::add_attribute | ( | Gtk::CellRenderer& | cell, |
const Glib::ustring & | property_name, | ||
const TreeModelColumnBase& | column | ||
) |
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.
- Parameters
-
x_offset Location to return x offset of a cell relative to cell_area. y_offset Location to return y offset of a cell relative to cell_area. width Location to return width needed to render a cell. height Location to return height needed to render a cell.
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()
- Returns
true
, if any of the cells packed into the tree_column are currently visible.
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.
- Parameters
-
tree_model The Gtk::TreeModel to get the cell renderers attributes from. iter The Gtk::TreeIter 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::TreeViewColumn::clear | ( | ) |
Unsets all the mappings on all renderers on the tree_column.
void Gtk::TreeViewColumn::clear_attributes | ( | CellRenderer& | cell_renderer | ) |
Clears all existing attributes previously set with set_attributes().
- Parameters
-
cell_renderer A Gtk::CellRenderer to clear the attribute mapping on.
void Gtk::TreeViewColumn::clicked | ( | ) |
Emits the “clicked” signal on the column.
This function will only work if tree_column is clickable.
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.
- Parameters
-
cell A Gtk::CellRenderer.
float Gtk::TreeViewColumn::get_alignment | ( | ) | const |
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.
Button* Gtk::TreeViewColumn::get_button | ( | ) |
Returns the button used in the treeview column header.
- Returns
- The button for the column header.
const Button* Gtk::TreeViewColumn::get_button | ( | ) | const |
Returns the button used in the treeview column header.
- Returns
- The button for the column header.
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.
- Parameters
-
cell_renderer A Gtk::CellRenderer. start_pos Return location for the horizontal position of cell within tree_column. width Return location for the width of cell.
- Returns
true
if cell belongs to tree_column.
bool Gtk::TreeViewColumn::get_clickable | ( | ) | const |
Returns true
if the user can click on the header for the column.
- Returns
true
if user can click the column header.
bool Gtk::TreeViewColumn::get_expand | ( | ) | const |
Returns true
if the column expands to fill available space.
- Returns
true
if the column expands to fill available space.
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().
- Returns
- The fixed width of the column.
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.
- Returns
- The maximum width of the tree_column.
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.
- Returns
- The minimum width of the tree_column.
bool Gtk::TreeViewColumn::get_reorderable | ( | ) | const |
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 Gtk::TreeViewColumn::get_resizable | ( | ) | const |
Returns true
if the tree_column can be resized by the end user.
- Returns
true
, if the tree_column can be resized.
Sizing Gtk::TreeViewColumn::get_sizing | ( | ) |
Returns the current type of tree_column.
- Returns
- The type of tree_column.
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().
- Returns
- The current sort_column_id for this column, or -1 if this column can’t be used for sorting.
bool Gtk::TreeViewColumn::get_sort_indicator | ( | ) | const |
Gets the value set by set_sort_indicator().
- Returns
- Whether the sort indicator arrow is displayed.
SortType Gtk::TreeViewColumn::get_sort_order | ( | ) | const |
Gets the value set by set_sort_order().
- Returns
- The sort order the sort indicator is indicating.
int Gtk::TreeViewColumn::get_spacing | ( | ) | const |
Returns the spacing of tree_column.
- Returns
- The spacing of tree_column.
Glib::ustring Gtk::TreeViewColumn::get_title | ( | ) | const |
Returns the title of the widget.
- Returns
- The title of the column. This string should not be modified or freed.
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.
- Returns
- The tree view wherein column has been inserted if any,
nullptr
otherwise.
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.
- Returns
- The tree view wherein column has been inserted if any,
nullptr
otherwise.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
bool Gtk::TreeViewColumn::get_visible | ( | ) | const |
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* 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.
- Returns
- The Gtk::Widget in the column header, or
nullptr
.
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.
- Returns
- The Gtk::Widget in the column header, or
nullptr
.
int Gtk::TreeViewColumn::get_width | ( | ) | const |
Returns the current size of tree_column in pixels.
- Returns
- The current width of tree_column.
int Gtk::TreeViewColumn::get_x_offset | ( | ) | const |
Returns the current X offset of tree_column in pixels.
- Returns
- The current X offset of tree_column.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
|
noexcept |
|
delete |
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
.
- Parameters
-
cell The Gtk::CellRenderer. expand true
if cell is to be given extra space allocated to tree_column.
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
-
column The model column that will be rendered by the view cell. expand true
if the cell is to be given extra space allocated to the view column.
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
.
- Parameters
-
cell The Gtk::CellRenderer. expand true
if cell is to be given extra space allocated to tree_column.
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
-
column The model column that will be rendered by the view cell. expand true
if the cell is to be given extra space allocated to the view column.
Glib::PropertyProxy< float > Gtk::TreeViewColumn::property_alignment | ( | ) |
X Alignment of the column header text or widget.
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.
Glib::PropertyProxy_ReadOnly< float > Gtk::TreeViewColumn::property_alignment | ( | ) | const |
X Alignment of the column header text or widget.
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.
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.
Glib::PropertyProxy< bool > Gtk::TreeViewColumn::property_clickable | ( | ) |
Whether the header can be clicked.
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.
Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeViewColumn::property_clickable | ( | ) | const |
Whether the header can be clicked.
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.
Glib::PropertyProxy< bool > Gtk::TreeViewColumn::property_expand | ( | ) |
Column gets share of extra width allocated to the widget.
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.
Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeViewColumn::property_expand | ( | ) | const |
Column gets share of extra width allocated to the widget.
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.
Glib::PropertyProxy< int > Gtk::TreeViewColumn::property_fixed_width | ( | ) |
Current fixed width of the column.
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.
Glib::PropertyProxy_ReadOnly< int > Gtk::TreeViewColumn::property_fixed_width | ( | ) | const |
Current fixed width of the column.
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.
Glib::PropertyProxy< int > Gtk::TreeViewColumn::property_max_width | ( | ) |
Maximum allowed width of the column.
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.
Glib::PropertyProxy_ReadOnly< int > Gtk::TreeViewColumn::property_max_width | ( | ) | const |
Maximum allowed width of the column.
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.
Glib::PropertyProxy< int > Gtk::TreeViewColumn::property_min_width | ( | ) |
Minimum allowed width of the column.
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.
Glib::PropertyProxy_ReadOnly< int > Gtk::TreeViewColumn::property_min_width | ( | ) | const |
Minimum allowed width of the column.
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.
Glib::PropertyProxy< bool > Gtk::TreeViewColumn::property_reorderable | ( | ) |
Whether the column can be reordered around the headers.
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.
Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeViewColumn::property_reorderable | ( | ) | const |
Whether the column can be reordered around the headers.
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.
Glib::PropertyProxy< bool > Gtk::TreeViewColumn::property_resizable | ( | ) |
Column is user-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.
Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeViewColumn::property_resizable | ( | ) | const |
Column is user-resizable.
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.
Glib::PropertyProxy< Sizing > Gtk::TreeViewColumn::property_sizing | ( | ) |
Resize mode of the column.
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.
Glib::PropertyProxy_ReadOnly< Sizing > Gtk::TreeViewColumn::property_sizing | ( | ) | const |
Resize mode of the column.
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.
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.
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.
Glib::PropertyProxy< bool > Gtk::TreeViewColumn::property_sort_indicator | ( | ) |
Whether to show a 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.
Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeViewColumn::property_sort_indicator | ( | ) | const |
Whether to show a sort indicator.
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.
Glib::PropertyProxy< SortType > Gtk::TreeViewColumn::property_sort_order | ( | ) |
Sort direction the sort indicator should indicate.
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.
Glib::PropertyProxy_ReadOnly< SortType > Gtk::TreeViewColumn::property_sort_order | ( | ) | const |
Sort direction the sort indicator should indicate.
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.
Glib::PropertyProxy< int > Gtk::TreeViewColumn::property_spacing | ( | ) |
Space which is inserted between cells.
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.
Glib::PropertyProxy_ReadOnly< int > Gtk::TreeViewColumn::property_spacing | ( | ) | const |
Space which is inserted between cells.
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.
Glib::PropertyProxy< Glib::ustring > Gtk::TreeViewColumn::property_title | ( | ) |
Title to appear in column header.
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.
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::TreeViewColumn::property_title | ( | ) | const |
Title to appear in column header.
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.
Glib::PropertyProxy< bool > Gtk::TreeViewColumn::property_visible | ( | ) |
Whether to display the column.
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.
Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeViewColumn::property_visible | ( | ) | const |
Whether to display the column.
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.
Glib::PropertyProxy< Widget* > Gtk::TreeViewColumn::property_widget | ( | ) |
Widget to put in column header button instead of column title.
- 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.
Glib::PropertyProxy_ReadOnly< Widget* > Gtk::TreeViewColumn::property_widget | ( | ) | const |
Widget to put in column header button instead of column title.
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< int > Gtk::TreeViewColumn::property_width | ( | ) | const |
Current width of the column.
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.
Glib::PropertyProxy_ReadOnly< int > Gtk::TreeViewColumn::property_x_offset | ( | ) | const |
Current X position of the column.
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.
void Gtk::TreeViewColumn::queue_resize | ( | ) |
Flags the column, and the cell renderers added to this column, to have their sizes renegotiated.
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.
- Parameters
-
xalign The alignment, which is between [0.0 and 1.0] inclusive.
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.
- Parameters
-
xalign The alignment, which is between [0.0 and 1.0] inclusive.
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_renderer A Gtk::CellRenderer slot The callback slot to use. Create this with sigc::mem_fun(), or sigc::ptr_fun().
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.
- Parameters
-
clickable true
if the header is active.
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.
- Parameters
-
expand true
if the column should expand to fill available space.
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.
- Parameters
-
fixed_width The new fixed width, in pixels, or -1.
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.
- Parameters
-
max_width The maximum width of the column in pixels, or -1.
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.
- Parameters
-
min_width The minimum width of the column in pixels, or -1.
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
-
renderer The view cell renderer which will render the model column. column The model column to be renderered by this view.
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.
- Parameters
-
reorderable true
, if the column can be reordered.
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.
- Parameters
-
resizable true
, if the column can be resized.
void Gtk::TreeViewColumn::set_sizing | ( | Sizing | type | ) |
Sets the growth behavior of tree_column to type.
- Parameters
-
type The Gtk::TreeViewColumn::Sizing.
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.
- Parameters
-
sort_column_id The sort_column_id of the model to sort on.
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.
- Parameters
-
sort_column_id The sort_column_id of the model to sort on.
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.
- Parameters
-
setting true
to display an indicator that the column is sorted.
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().
- Parameters
-
order Sort order that the sort indicator should indicate.
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.
- Parameters
-
spacing Distance between cell renderers in pixels.
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.
- Parameters
-
title The title of the tree_column.
void Gtk::TreeViewColumn::set_visible | ( | bool | visible = true | ) |
Sets the visibility of tree_column.
- Parameters
-
visible true
if the tree_column is visible.
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.
- Parameters
-
widget A child Gtk::Widget, or nullptr
.
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.
void Gtk::TreeViewColumn::unset_cell_data_func | ( | CellRenderer& | cell_renderer | ) |
Removes a previously set callback slot.
See set_cell_data_func().
Friends And Related Function Documentation
|
related |
A Glib::wrap() method for this object.
- Parameters
-
object The C instance. take_copy False 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.