gtkmm: Gtk::ColumnViewColumn Class Reference

gtkmm 4.9.1

Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gtk::ColumnViewColumn Class Reference

The column added to Gtk::ColumnView. More...

`#include <gtkmm/columnviewcolumn.h>`

Inheritance diagram for Gtk::ColumnViewColumn:
[legend]

## Public Member Functions
| ColumnViewColumn (ColumnViewColumn && src) noexcept
ColumnViewColumn & | operator= (ColumnViewColumn && src) noexcept
| ~ColumnViewColumn () noexcept override
GtkColumnViewColumn * | gobj ()
| Provides access to the underlying C GObject. More...
const GtkColumnViewColumn * | gobj () const
| Provides access to the underlying C GObject. More...
GtkColumnViewColumn * | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
ColumnView * | get_column_view ()
| Gets the column view that's currently displaying this column. More...
const ColumnView * | get_column_view () const
| Gets the column view that's currently displaying this column. More...
void | set_factory (const Glib::RefPtr< ListItemFactory > & factory)
| Sets the `Gtk::ListItemFactory` to use for populating list items for this column. More...
Glib::RefPtr< ListItemFactory > | get_factory ()
| Gets the factory that's currently used to populate list items for this column. More...
Glib::RefPtr< const ListItemFactory > | get_factory () const
| Gets the factory that's currently used to populate list items for this column. More...
void | set_title (const Glib::ustring & title)
| Sets the title of this column. More...
Glib::ustring | get_title () const
| Returns the title set with set_title(). More...
void | set_sorter (const Glib::RefPtr< Sorter > & sorter)
| Associates a sorter with the column. More...
Glib::RefPtr< Sorter > | get_sorter ()
| Returns the sorter that is associated with the column. More...
Glib::RefPtr< const Sorter > | get_sorter () const
| Returns the sorter that is associated with the column. More...
void | set_visible (bool visible=true)
| Sets whether this column should be visible in views. More...
bool | get_visible () const
| Returns whether this column is visible. More...
void | set_header_menu (const Glib::RefPtr< Gio::MenuModel > & model)
| Sets the menu model that is used to create the context menu for the column header. More...
Glib::RefPtr< Gio::MenuModel > | get_header_menu ()
| Gets the menu model that is used to create the context menu for the column header. More...
Glib::RefPtr< const Gio::MenuModel > | get_header_menu () const
| Gets the menu model that is used to create the context menu for the column header. More...
void | set_fixed_width (int fixed_width)
| If fixed_width is not -1, sets the fixed width of column; otherwise unsets it. More...
int | get_fixed_width () const
| Gets the fixed width of the column. More...
void | set_resizable (bool resizable=true)
| Sets whether this column should be resizable by dragging. More...
bool | get_resizable () const
| Returns whether this column is resizable. More...
void | set_expand (bool expand=true)
| Sets the column to take available extra space. More...
bool | get_expand () const
| Returns whether this column should expand. More...
void | set_id (const Glib::ustring & id)
| Sets the id of this column. More...
Glib::ustring | get_id () const
| Returns the ID set with set_id(). More...
Glib::PropertyProxy_ReadOnly< ColumnView * > | property_column_view () const
| The `Gtk::ColumnView` this column is a part of. More...
Glib::PropertyProxy< Glib::RefPtr< ListItemFactory > > | property_factory ()
| Factory for populating list items. More...
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ListItemFactory > > | property_factory () const
| Factory for populating list items. More...
Glib::PropertyProxy< Glib::ustring > | property_title ()
| Title displayed in the header. More...
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_title () const
| Title displayed in the header. More...
Glib::PropertyProxy< Glib::RefPtr< Sorter > > | property_sorter ()
| Sorter for sorting items according to this column. More...
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Sorter > > | property_sorter () const
| Sorter for sorting items according to this column. More...
Glib::PropertyProxy< bool > | property_visible ()
| Whether this column is visible. More...
Glib::PropertyProxy_ReadOnly< bool > | property_visible () const
| Whether this column is visible. More...
Glib::PropertyProxy< Glib::RefPtr< Gio::MenuModel > > | property_header_menu ()
| Menu model used to create the context menu for the column header. More...
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gio::MenuModel > > | property_header_menu () const
| Menu model used to create the context menu for the column header. More...
Glib::PropertyProxy< bool > | property_resizable ()
| Whether this column is resizable. More...
Glib::PropertyProxy_ReadOnly< bool > | property_resizable () const
| Whether this column is resizable. More...
Glib::PropertyProxy< bool > | property_expand ()
| Column gets share of extra width allocated to the view. More...
Glib::PropertyProxy_ReadOnly< bool > | property_expand () const
| Column gets share of extra width allocated to the view. More...
Glib::PropertyProxy< int > | property_fixed_width ()
| If not -1, this is the width that the column is allocated, regardless of the size of its content. More...
Glib::PropertyProxy_ReadOnly< int > | property_fixed_width () const
| If not -1, this is the width that the column is allocated, regardless of the size of its content. More...
Glib::PropertyProxy< Glib::ustring > | property_id ()
| An ID for the column. More...
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_id () const
| An ID for the column. More...
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

## Static Public Member Functions
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static Glib::RefPtr< ColumnViewColumn > | create (const Glib::ustring & title, const Glib::RefPtr< ListItemFactory > & factory={})

## Protected Member Functions
| ColumnViewColumn (const Glib::ustring & title, const Glib::RefPtr< ListItemFactory > & factory={})
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)

## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gtk::ColumnViewColumn > | wrap (GtkColumnViewColumn * object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Additional Inherited Members
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

## Detailed Description

The column added to Gtk::ColumnView.

Gtk::ColumnViewColumn represents the columns being added to Gtk::ColumnView.

Columns have a title, and can optionally have a header menu set with set_header_menu().

A sorter can be associated with a column using set_sorter(), to let users influence sorting by clicking on the column header.

See also
  Gtk::ColumnView

## Constructor & Destructor Documentation

## ◆ ColumnViewColumn() [1/2]

Gtk::ColumnViewColumn::ColumnViewColumn | ( | ColumnViewColumn && | src | ) |
| noexcept

## ◆ ~ColumnViewColumn()

Gtk::ColumnViewColumn::~ColumnViewColumn | ( |  | ) |
| overridenoexcept

## ◆ ColumnViewColumn() [2/2]

Gtk::ColumnViewColumn::ColumnViewColumn | ( | const Glib::ustring & | title,
|  | const Glib::RefPtr< ListItemFactory > & | factory = `{}`
| ) |  |
| explicitprotected

## Member Function Documentation

## ◆ create()

static Glib::RefPtr<ColumnViewColumn> Gtk::ColumnViewColumn::create | ( | const Glib::ustring & | title,
|  | const Glib::RefPtr< ListItemFactory > & | factory = `{}`
| ) |  |
| static

## ◆ get_column_view() [1/2]

ColumnView* Gtk::ColumnViewColumn::get_column_view | ( |  | ) |

Gets the column view that's currently displaying this column.

If self has not been added to a column view yet, `nullptr` is returned.

Returns
  The column view displaying self.

## ◆ get_column_view() [2/2]

const ColumnView* Gtk::ColumnViewColumn::get_column_view | ( |  | ) | const

Gets the column view that's currently displaying this column.

If self has not been added to a column view yet, `nullptr` is returned.

Returns
  The column view displaying self.

## ◆ get_expand()

bool Gtk::ColumnViewColumn::get_expand | ( |  | ) | const

Returns whether this column should expand.

Returns
  `true` if this column expands.

## ◆ get_factory() [1/2]

Glib::RefPtr<ListItemFactory> Gtk::ColumnViewColumn::get_factory | ( |  | ) |

Gets the factory that's currently used to populate list items for this column.

Returns
  The factory in use.

## ◆ get_factory() [2/2]

Glib::RefPtr<const ListItemFactory> Gtk::ColumnViewColumn::get_factory | ( |  | ) | const

Gets the factory that's currently used to populate list items for this column.

Returns
  The factory in use.

## ◆ get_fixed_width()

int Gtk::ColumnViewColumn::get_fixed_width | ( |  | ) | const

Gets the fixed width of the column.

Returns
  The fixed with of the column.

## ◆ get_header_menu() [1/2]

Glib::RefPtr<Gio::MenuModel> Gtk::ColumnViewColumn::get_header_menu | ( |  | ) |

Gets the menu model that is used to create the context menu for the column header.

Returns
  The `Gio::MenuModel`.

## ◆ get_header_menu() [2/2]

Glib::RefPtr<const Gio::MenuModel> Gtk::ColumnViewColumn::get_header_menu | ( |  | ) | const

Gets the menu model that is used to create the context menu for the column header.

Returns
  The `Gio::MenuModel`.

## ◆ get_id()

Glib::ustring Gtk::ColumnViewColumn::get_id | ( |  | ) | const

Returns the ID set with set_id().

Since gtkmm 4.10:

Returns
  The column's ID.

## ◆ get_resizable()

bool Gtk::ColumnViewColumn::get_resizable | ( |  | ) | const

Returns whether this column is resizable.

Returns
  `true` if this column is resizable.

## ◆ get_sorter() [1/2]

Glib::RefPtr<Sorter> Gtk::ColumnViewColumn::get_sorter | ( |  | ) |

Returns the sorter that is associated with the column.

Returns
  The `Gtk::Sorter` of self.

## ◆ get_sorter() [2/2]

Glib::RefPtr<const Sorter> Gtk::ColumnViewColumn::get_sorter | ( |  | ) | const

Returns the sorter that is associated with the column.

Returns
  The `Gtk::Sorter` of self.

## ◆ get_title()

Glib::ustring Gtk::ColumnViewColumn::get_title | ( |  | ) | const

Returns the title set with set_title().

Returns
  The column's title.

## ◆ get_type()

static GType Gtk::ColumnViewColumn::get_type | ( |  | ) |
| static

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

## ◆ get_visible()

bool Gtk::ColumnViewColumn::get_visible | ( |  | ) | const

Returns whether this column is visible.

Returns
  `true` if this column is visible.

## ◆ gobj() [1/2]

GtkColumnViewColumn* Gtk::ColumnViewColumn::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const GtkColumnViewColumn* Gtk::ColumnViewColumn::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ gobj_copy()

GtkColumnViewColumn* Gtk::ColumnViewColumn::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

## ◆ operator=()

ColumnViewColumn& Gtk::ColumnViewColumn::operator= | ( | ColumnViewColumn && | src | ) |
| noexcept

## ◆ property_column_view()

Glib::PropertyProxy_ReadOnly< ColumnView* > Gtk::ColumnViewColumn::property_column_view | ( |  | ) | const

The `Gtk::ColumnView` this column is a part of.

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::ColumnViewColumn::property_expand | ( |  | ) |

Column gets share of extra width allocated to the view.

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::ColumnViewColumn::property_expand | ( |  | ) | const

Column gets share of extra width allocated to the view.

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_factory() [1/2]

Glib::PropertyProxy< Glib::RefPtr<ListItemFactory> > Gtk::ColumnViewColumn::property_factory | ( |  | ) |

Factory for populating list items.

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_factory() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<ListItemFactory> > Gtk::ColumnViewColumn::property_factory | ( |  | ) | const

Factory for populating list items.

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::ColumnViewColumn::property_fixed_width | ( |  | ) |

If not -1, this is the width that the column is allocated, regardless of the size of its content.

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::ColumnViewColumn::property_fixed_width | ( |  | ) | const

If not -1, this is the width that the column is allocated, regardless of the size of its content.

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_header_menu() [1/2]

Glib::PropertyProxy< Glib::RefPtr<Gio::MenuModel> > Gtk::ColumnViewColumn::property_header_menu | ( |  | ) |

Menu model used to create the context menu for the column header.

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_header_menu() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gio::MenuModel> > Gtk::ColumnViewColumn::property_header_menu | ( |  | ) | const

Menu model used to create the context menu for the column header.

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_id() [1/2]

Glib::PropertyProxy< Glib::ustring > Gtk::ColumnViewColumn::property_id | ( |  | ) |

An ID for the column.

GTK is not currently using the ID for anything, but it can be used by applications when saving column view configurations.

It is up to applications to ensure uniqueness of IDs.

Since gtkmm 4.10:

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_id() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::ColumnViewColumn::property_id | ( |  | ) | const

An ID for the column.

GTK is not currently using the ID for anything, but it can be used by applications when saving column view configurations.

It is up to applications to ensure uniqueness of IDs.

Since gtkmm 4.10:

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_resizable() [1/2]

Glib::PropertyProxy< bool > Gtk::ColumnViewColumn::property_resizable | ( |  | ) |

Whether this column is 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::ColumnViewColumn::property_resizable | ( |  | ) | const

Whether this column is 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.

## ◆ property_sorter() [1/2]

Glib::PropertyProxy< Glib::RefPtr<Sorter> > Gtk::ColumnViewColumn::property_sorter | ( |  | ) |

Sorter for sorting items according to this column.

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_sorter() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Sorter> > Gtk::ColumnViewColumn::property_sorter | ( |  | ) | const

Sorter for sorting items according to this column.

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::ColumnViewColumn::property_title | ( |  | ) |

Title displayed in the 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.

## ◆ property_title() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::ColumnViewColumn::property_title | ( |  | ) | const

Title displayed in the 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.

## ◆ property_visible() [1/2]

Glib::PropertyProxy< bool > Gtk::ColumnViewColumn::property_visible | ( |  | ) |

Whether this column is 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::ColumnViewColumn::property_visible | ( |  | ) | const

Whether this column is visible.

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.

## ◆ set_expand()

void Gtk::ColumnViewColumn::set_expand | ( | bool | expand = `true` | ) |

Sets the column to take available extra space.

The extra space is shared equally amongst all columns that have the expand set to `true`.

Parameters

  expand | `true` if this column should expand to fill available sace.

## ◆ set_factory()

void Gtk::ColumnViewColumn::set_factory | ( | const Glib::RefPtr< ListItemFactory > & | factory | ) |

Sets the `Gtk::ListItemFactory` to use for populating list items for this column.

Parameters

  factory | The factory to use.

## ◆ set_fixed_width()

void Gtk::ColumnViewColumn::set_fixed_width | ( | int | fixed_width | ) |

If fixed_width is not -1, sets the fixed width of column; otherwise unsets it.

Setting a fixed width overrides the automatically calculated width. Interactive resizing also sets the “fixed-width” property.

Parameters

  fixed_width | The new fixed width, or -1.

## ◆ set_header_menu()

void Gtk::ColumnViewColumn::set_header_menu | ( | const Glib::RefPtr< Gio::MenuModel > & | model | ) |

Sets the menu model that is used to create the context menu for the column header.

Parameters

  model | A `Gio::MenuModel`.

## ◆ set_id()

void Gtk::ColumnViewColumn::set_id | ( | const Glib::ustring & | id | ) |

Sets the id of this column.

GTK makes no use of this, but applications can use it when storing column view configuration.

It is up to callers to ensure uniqueness of IDs.

Since gtkmm 4.10:

Parameters

  id | ID to use for this column.

## ◆ set_resizable()

void Gtk::ColumnViewColumn::set_resizable | ( | bool | resizable = `true` | ) |

Sets whether this column should be resizable by dragging.

Parameters

  resizable | Whether this column should be resizable.

## ◆ set_sorter()

void Gtk::ColumnViewColumn::set_sorter | ( | const Glib::RefPtr< Sorter > & | sorter | ) |

Associates a sorter with the column.

If sorter is `nullptr`, the column will not let users change the sorting by clicking on its header.

This sorter can be made active by clicking on the column header, or by calling sort_by_column().

See get_sorter() for the necessary steps for setting up customizable sorting for Gtk::ColumnView.

Parameters

  sorter | The `Gtk::Sorter` to associate with column.

## ◆ set_title()

void Gtk::ColumnViewColumn::set_title | ( | const Glib::ustring & | title | ) |

Sets the title of this column.

The title is displayed in the header of a `Gtk::ColumnView` for this column and is therefore user-facing text that should be translated.

Parameters

  title | Title to use for this column.

## ◆ set_visible()

void Gtk::ColumnViewColumn::set_visible | ( | bool | visible = `true` | ) |

Sets whether this column should be visible in views.

Parameters

  visible | Whether this column should be visible.

## Friends And Related Function Documentation

## ◆ wrap()

Glib::RefPtr< Gtk::ColumnViewColumn > wrap | ( | GtkColumnViewColumn * | object,
|  | bool | take_copy = `false`
| ) |  |
| 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.