Gtk.ColumnViewColumn¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.ColumnViewColumn(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GtkColumnViewColumn
represents the columns being added to aGtkColumnView
.The main ingredient for a
GtkColumnViewColumn
is theGtkListItemFactory
that tells the columnview how to create cells for this column from items in the model.Columns have a title, and can optionally have a header menu set with [method`Gtk`.ColumnViewColumn.set_header_menu].
A sorter can be associated with a column using [method`Gtk`.ColumnViewColumn.set_sorter], to let users influence sorting by clicking on the column header.
- classmethod new(title, factory)[source]¶
- Parameters:
factory (
Gtk.ListItemFactory
orNone
) – The factory to populate items with
- Returns:
a new
GtkColumnViewColumn
using the given factory- Return type:
Creates a new
GtkColumnViewColumn
that uses the given factory for mapping items to widgets.You most likely want to call [method`Gtk`.ColumnView.append_column] next.
The function takes ownership of the argument, so you can write code like:
``c column = gtk_column_view_column_new (_(“Name”),
gtk_builder_list_item_factory_new_from_resource (“/name.ui”));
- get_column_view()[source]¶
- Returns:
The column view displaying self.
- Return type:
Gets the column view that’s currently displaying this column.
If self has not been added to a column view yet,
None
is returned.
- get_factory()[source]¶
- Returns:
The factory in use
- Return type:
Gets the factory that’s currently used to populate list items for this column.
- get_fixed_width()[source]¶
- Returns:
the fixed with of the column
- Return type:
Gets the fixed width of the column.
- Returns:
the
GMenuModel
- Return type:
Gets the menu model that is used to create the context menu for the column header.
- get_id()[source]¶
-
Returns the ID set with
Gtk.ColumnViewColumn.set_id
().New in version 4.10.
- get_sorter()[source]¶
- Returns:
the
GtkSorter
of self- Return type:
Gtk.Sorter
orNone
Returns the sorter that is associated with the column.
- get_title()[source]¶
-
Returns the title set with
Gtk.ColumnViewColumn.set_title
().
- set_expand(expand)[source]¶
-
Sets the column to take available extra space.
The extra space is shared equally amongst all columns that have the expand set to
True
.
- set_factory(factory)[source]¶
- Parameters:
factory (
Gtk.ListItemFactory
orNone
) – the factory to use
Sets the
GtkListItemFactory
to use for populating list items for this column.
- set_fixed_width(fixed_width)[source]¶
- Parameters:
fixed_width (
int
) – the new fixed width, or -1
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:
menu (
Gio.MenuModel
orNone
) – aGMenuModel
Sets the menu model that is used to create the context menu for the column header.
- set_id(id)[source]¶
-
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.
New in version 4.10.
- set_resizable(resizable)[source]¶
- Parameters:
resizable (
bool
) – whether this column should be resizable
Sets whether this column should be resizable by dragging.
- set_sorter(sorter)[source]¶
- Parameters:
sorter (
Gtk.Sorter
orNone
) – theGtkSorter
to associate with column
Associates a sorter with the column.
If sorter is
None
, 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 [method`Gtk`.ColumnView.sort_by_column].
See [method`Gtk`.ColumnView.get_sorter] for the necessary steps for setting up customizable sorting for [class`Gtk`.ColumnView].
Property Details¶
- Gtk.ColumnViewColumn.props.column_view¶
- Name:
column-view
- Type:
- Default Value:
- Flags:
The
GtkColumnView
this column is a part of.
- Gtk.ColumnViewColumn.props.expand¶
- Name:
expand
- Type:
- Default Value:
- Flags:
Column gets share of extra width allocated to the view.
- Gtk.ColumnViewColumn.props.factory¶
- Name:
factory
- Type:
- Default Value:
- Flags:
Factory for populating list items.
- Gtk.ColumnViewColumn.props.fixed_width¶
- Name:
fixed-width
- Type:
- Default Value:
-1
- Flags:
If not -1, this is the width that the column is allocated, regardless of the size of its content.
- Name:
header-menu
- Type:
- Default Value:
- Flags:
Menu model used to create the context menu for the column header.
- Gtk.ColumnViewColumn.props.id¶
- Name:
id
- Type:
- Default Value:
- Flags:
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.
New in version 4.10.
- Gtk.ColumnViewColumn.props.resizable¶
- Name:
resizable
- Type:
- Default Value:
- Flags:
Whether this column is resizable.
- Gtk.ColumnViewColumn.props.sorter¶
- Name:
sorter
- Type:
- Default Value:
- Flags:
Sorter for sorting items according to this column.
- Gtk.ColumnViewColumn.props.title¶
- Name:
title
- Type:
- Default Value:
- Flags:
Title displayed in the header.