GtkColumnViewColumn — The column added to GtkColumnView
GtkColumnViewColumn * | gtk_column_view_column_new () |
GtkColumnView * | gtk_column_view_column_get_column_view () |
void | gtk_column_view_column_set_factory () |
GtkListItemFactory * | gtk_column_view_column_get_factory () |
void | gtk_column_view_column_set_title () |
const char * | gtk_column_view_column_get_title () |
void | gtk_column_view_column_set_sorter () |
GtkSorter * | gtk_column_view_column_get_sorter () |
void | gtk_column_view_column_set_visible () |
gboolean | gtk_column_view_column_get_visible () |
void | gtk_column_view_column_set_resizable () |
gboolean | gtk_column_view_column_get_resizable () |
void | gtk_column_view_column_set_header_menu () |
GMenuModel * | gtk_column_view_column_get_header_menu () |
void | gtk_column_view_column_set_fixed_width () |
int | gtk_column_view_column_get_fixed_width () |
void | gtk_column_view_column_set_expand () |
gboolean | gtk_column_view_column_get_expand () |
GtkColumnView * | column-view | Read |
gboolean | expand | Read / Write |
GtkListItemFactory * | factory | Read / Write |
int | fixed-width | Read / Write |
GMenuModel * | header-menu | Read / Write |
gboolean | resizable | Read / Write |
GtkSorter * | sorter | Read / Write |
char * | title | Read / Write |
gboolean | visible | Read / Write |
GObject ╰── GtkColumnViewColumn
#include <gtk/gtk.h>
GtkColumnViewColumn represents the columns being added to GtkColumnView.
Columns have a title, and can optionally have a header menu set with gtk_column_view_column_set_header_menu()
.
A sorter can be associated with a column using gtk_column_view_column_set_sorter()
, to let users influence sorting by clicking on the column header.
GtkColumnViewColumn * gtk_column_view_column_new (const char *title
,GtkListItemFactory *factory
);
Creates a new GtkColumnViewColumn that uses the given factory
for mapping items to widgets.
You most likely want to call gtk_column_add_column()
next.
The function takes ownership of the argument, so you can write code like
column = gtk_column_view_column_new (_("Name"),
gtk_builder_list_item_factory_new_from_resource ("/name.ui"));
title | Title to use for this column. | [nullable] |
factory | The factory to populate items with. | [transfer full][nullable] |
a new GtkColumnViewColumn using the given factory
GtkColumnView *
gtk_column_view_column_get_column_view
(GtkColumnViewColumn *self
);
Gets the column view that's currently displaying this column.
If self
has not been added to a column view yet, NULL
is returned.
self |
The column view displaying self
.
[nullable][transfer none]
void gtk_column_view_column_set_factory (GtkColumnViewColumn *self
,GtkListItemFactory *factory
);
Sets the GtkListItemFactory to use for populating list items for this column.
self | ||
factory | the factory to use or | [allow-none][transfer none] |
GtkListItemFactory *
gtk_column_view_column_get_factory (GtkColumnViewColumn *self
);
Gets the factory that's currently used to populate list items for this column.
self |
The factory in use.
[nullable][transfer none]
void gtk_column_view_column_set_title (GtkColumnViewColumn *self
,const char *title
);
Sets the title of this column. The title is displayed in the header of a GtkColumnView for this column and is therefore user-facing text that should be translated.
self | ||
title | Title to use for this column. | [nullable] |
const char *
gtk_column_view_column_get_title (GtkColumnViewColumn *self
);
Returns the title set with gtk_column_view_column_set_title()
.
self |
The column's title.
[nullable]
void gtk_column_view_column_set_sorter (GtkColumnViewColumn *self
,GtkSorter *sorter
);
Associates a sorter with the column.
If sorter
is NULL
, 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 gtk_column_view_sort_by_column()
.
See gtk_column_view_get_sorter()
for the necessary steps for setting up customizable sorting for GtkColumnView.
self | ||
sorter | the GtkSorter to associate with | [nullable] |
GtkSorter *
gtk_column_view_column_get_sorter (GtkColumnViewColumn *self
);
Returns the sorter that is associated with the column.
self |
void gtk_column_view_column_set_visible (GtkColumnViewColumn *self
,gboolean visible
);
Sets whether this column should be visible in views.
self | ||
visible | whether this column should be visible |
gboolean
gtk_column_view_column_get_visible (GtkColumnViewColumn *self
);
Returns whether this column is visible.
self |
TRUE
if this column is visible
void gtk_column_view_column_set_resizable (GtkColumnViewColumn *self
,gboolean resizable
);
Sets whether this column should be resizable by dragging.
self | ||
resizable | whether this column should be resizable |
gboolean
gtk_column_view_column_get_resizable (GtkColumnViewColumn *self
);
Returns whether this column is resizable.
self |
TRUE
if this column is resizable
void gtk_column_view_column_set_header_menu (GtkColumnViewColumn *self
,GMenuModel *menu
);
Sets the menu model that is used to create the context menu for the column header.
self | ||
menu | a GMenuModel, or | [allow-none] |
GMenuModel *
gtk_column_view_column_get_header_menu
(GtkColumnViewColumn *self
);
Gets the menu model that is used to create the context menu for the column header.
self |
the GMenuModel, or NULL
.
[transfer none][nullable]
void gtk_column_view_column_set_fixed_width (GtkColumnViewColumn *self
,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.
self | ||
fixed_width | the new fixed width, or -1 |
int
gtk_column_view_column_get_fixed_width
(GtkColumnViewColumn *self
);
Gets the fixed width of the column.
self |
the fixed with of the column
void gtk_column_view_column_set_expand (GtkColumnViewColumn *self
,gboolean expand
);
Sets the column to take available extra space.
The extra space is shared equally amongst all columns that have the expand set to TRUE
.
self | ||
expand |
|
gboolean
gtk_column_view_column_get_expand (GtkColumnViewColumn *self
);
Returns whether this column should expand.
self |
TRUE
if this column expands
typedef struct _GtkColumnViewColumn GtkColumnViewColumn;
GtkColumnViewColumns are added to GtkColumnViews.
“column-view”
property“column-view” GtkColumnView *
GtkColumnView this column is a part of
Owner: GtkColumnViewColumn
Flags: Read
“expand”
property“expand” gboolean
Column gets share of extra width allocated to the view
Owner: GtkColumnViewColumn
Flags: Read / Write
Default value: FALSE
“factory”
property“factory” GtkListItemFactory *
Factory for populating list items
Owner: GtkColumnViewColumn
Flags: Read / Write
“fixed-width”
property“fixed-width” int
If not -1, this is the width that the column is allocated, regardless of the size of its content.
Owner: GtkColumnViewColumn
Flags: Read / Write
Allowed values: >= -1
Default value: -1
“header-menu”
property“header-menu” GMenuModel *
Menu model used to create the context menu for the column header.
Owner: GtkColumnViewColumn
Flags: Read / Write
“resizable”
property“resizable” gboolean
Whether this column is resizable
Owner: GtkColumnViewColumn
Flags: Read / Write
Default value: FALSE
“sorter”
property“sorter” GtkSorter *
Sorter for sorting items according to this column
Owner: GtkColumnViewColumn
Flags: Read / Write
“title”
property“title” char *
Title displayed in the header
Owner: GtkColumnViewColumn
Flags: Read / Write
Default value: NULL
“visible”
property“visible” gboolean
Whether this column is visible
Owner: GtkColumnViewColumn
Flags: Read / Write
Default value: TRUE
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkColumnViewColumn.html