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

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

#include <gtkmm/columnviewcolumn.h>

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

Public Member Functions

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

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system.
 
static Glib::RefPtr< ColumnViewColumncreate (const Glib::ustring &title, const Glib::RefPtr< ListItemFactory > &factory={})
 

Protected Member Functions

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

Related Symbols

(Note that these are not member symbols.)

Glib::RefPtr< Gtk::ColumnViewColumnwrap (GtkColumnViewColumn *object, bool take_copy=false)
 A Glib::wrap() method for this object.
 

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.

The factory must be for configuring Gtk::ColumnViewCell objects.

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.

The factory must be for configuring Gtk::ColumnViewCell objects.

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
expandtrue 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
factoryThe 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_widthThe 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
modelA 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
idID 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
resizableWhether 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
sorterThe 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
titleTitle 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
visibleWhether this column should be visible.

Friends And Related Symbol Documentation

◆ wrap()

Glib::RefPtr< Gtk::ColumnViewColumn > wrap ( GtkColumnViewColumn 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.