CellView#
Deprecated since version 4.10:
- List views use widgets to display their contents.
You can use
Boxinstead
Superclasses: Widget, InitiallyUnowned, Object
Implemented Interfaces: Accessible, Buildable, CellLayout, ConstraintTarget, Orientable
A widget displaying a single row of a GtkTreeModel
A GtkCellView displays a single row of a GtkTreeModel using a GtkCellArea
and GtkCellAreaContext. A GtkCellAreaContext can be provided to the
GtkCellView at construction time in order to keep the cellview in context
of a group of cell views, this ensures that the renderers displayed will
be properly aligned with each other (like the aligned cells in the menus
of GtkComboBox).
GtkCellView is GtkOrientable in order to decide in which orientation
the underlying GtkCellAreaContext should be allocated. Taking the GtkComboBox
menu as an example, cellviews should be oriented horizontally if the menus are
listed top-to-bottom and thus all share the same width but may have separate
individual heights (left-to-right menus should be allocated vertically since
they all share the same height but may have variable widths).
CSS nodes#
GtkCellView has a single CSS node with name cellview.
Constructors#
- class CellView
- classmethod new() Widget#
Creates a new
GtkCellViewwidget.Deprecated since version 4.10: Please do not use it in newly written code
- classmethod new_with_context(area: CellArea, context: CellAreaContext) Widget#
Creates a new
GtkCellViewwidget with a specificGtkCellAreato layout cells and a specificGtkCellAreaContext.Specifying the same context for a handful of cells lets the underlying area synchronize the geometry for those cells, in this way alignments with cellviews for other rows are possible.
Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
area – the
GtkCellAreato layout cellscontext – the
GtkCellAreaContextin which to calculate cell geometry
- classmethod new_with_markup(markup: str) Widget#
Creates a new
GtkCellViewwidget, adds aGtkCellRendererTextto it, and makes it showmarkup. The text can be marked up with the Pango text markup language.Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
markup – the text to display in the cell view
Methods#
- class CellView
- get_displayed_row() TreePath | None#
Returns a
GtkTreePathreferring to the currently displayed row. If no row is currently displayed,Noneis returned.Deprecated since version 4.10: Please do not use it in newly written code
- get_draw_sensitive() bool#
Gets whether
cell_viewis configured to draw all of its cells in a sensitive state.Deprecated since version 4.10: Please do not use it in newly written code
- get_fit_model() bool#
Gets whether
cell_viewis configured to request space to fit the entireGtkTreeModel.Deprecated since version 4.10: Please do not use it in newly written code
- get_model() TreeModel | None#
Returns the model for
cell_view. If no model is usedNoneis returned.Deprecated since version 4.10: Please do not use it in newly written code
- set_displayed_row(path: TreePath | None = None) None#
Sets the row of the model that is currently displayed by the
GtkCellView. If the path is unset, then the contents of the cellview “stick” at their last value; this is not normally a desired result, but may be a needed intermediate state if say, the model for theGtkCellViewbecomes temporarily empty.Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
path – a
GtkTreePathorNoneto unset.
- set_draw_sensitive(draw_sensitive: bool) None#
Sets whether
cell_viewshould draw all of its cells in a sensitive state, this is used byGtkComboBoxmenus to ensure that rows with insensitive cells that contain children appear sensitive in the parent menu item.Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
draw_sensitive – whether to draw all cells in a sensitive state.
- set_fit_model(fit_model: bool) None#
Sets whether
cell_viewshould request space to fit the entireGtkTreeModel.This is used by
GtkComboBoxto ensure that the cell view displayed on the combo box’s button always gets enough space and does not resize when selection changes.Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
fit_model – whether
cell_viewshould request space for the whole model.
- set_model(model: TreeModel | None = None) None#
Sets the model for
cell_view. Ifcell_viewalready has a model set, it will remove it before setting the new model. IfmodelisNone, then it will unset the old model.Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
model – a
GtkTreeModel
Properties#
- class CellView
-
- props.cell_area_context: CellAreaContext#
The type of the None singleton.