About all my projects
Gnome::Gtk4::CellView

Gnome::Gtk4::CellView

Description

A widget displaying a single row of a GtkTreeModel

A Gnome::Gtk4::CellView displays a single row of a Gnome::Gtk4::R-TreeModel using a Gnome::Gtk4::CellArea and Gnome::Gtk4::CellAreaContext. A Gnome::Gtk4::CellAreaContext can be provided to the Gnome::Gtk4::CellView 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 Gnome::Gtk4::ComboBox).

Gnome::Gtk4::CellView is Gnome::Gtk4::R-Orientable in order to decide in which orientation the underlying Gnome::Gtk4::CellAreaContext should be allocated. Taking the Gnome::Gtk4::ComboBox 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.

Class initialization

Note: The native version of this class is deprecated in gtk4-lib() since version 4.10

new

:native-object

Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object :$native-object! )

new-cellview

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Creates a new Gnome::Gtk4::CellView widget.

method new-cellview ( --> Gnome::Gtk4::CellView \)

new-with-context

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Creates a new Gnome::Gtk4::CellView widget with a specific Gnome::Gtk4::CellArea to layout cells and a specific Gnome::Gtk4::CellAreaContext.

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.

method new-with-context ( N-Object() $area, N-Object() $context --> Gnome::Gtk4::CellView \)
  • $area; the Gnome::Gtk4::CellArea to layout cells.

  • $context; the Gnome::Gtk4::CellAreaContext in which to calculate cell geometry.

new-with-markup

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Creates a new Gnome::Gtk4::CellView widget, adds a Gnome::Gtk4::CellRendererText to it, and makes it show $markup. The text can be marked up with the [Pango text markup language](https://docs.gtk.org/Pango/pango_markup.html).

method new-with-markup ( Str $markup --> Gnome::Gtk4::CellView \)
  • $markup; the text to display in the cell view.

new-with-text

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Creates a new Gnome::Gtk4::CellView widget, adds a Gnome::Gtk4::CellRendererText to it, and makes it show $text.

method new-with-text ( Str $text --> Gnome::Gtk4::CellView \)
  • $text; the text to display in the cell view.

new-with-texture

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Creates a new Gnome::Gtk4::CellView widget, adds a Gnome::Gtk4::CellRendererPixbuf to it, and makes it show $texture.

method new-with-texture ( N-Object() $texture --> Gnome::Gtk4::CellView \)
  • $texture; the image to display in the cell view.

Methods

get-displayed-row

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Returns a Gnome::Gtk4::N-TreePath referring to the currently displayed row. If no row is currently displayed, undefined is returned.

method get-displayed-row (--> N-Object )

Return value; the currently displayed row.

get-draw-sensitive

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Gets whether $cell-view is configured to draw all of its cells in a sensitive state.

method get-draw-sensitive (--> Bool )

Return value; whether $cell-view draws all of its cells in a sensitive state.

get-fit-model

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Gets whether $cell-view is configured to request space to fit the entire Gnome::Gtk4::R-TreeModel.

method get-fit-model (--> Bool )

Return value; whether $cell-view requests space to fit the entire Gnome::Gtk4::R-TreeModel..

get-model

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Returns the model for $cell-view. If no model is used undefined is returned.

method get-model (--> N-Object )

Return value; a Gnome::Gtk4::R-TreeModel used.

set-displayed-row

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Sets the row of the model that is currently displayed by the Gnome::Gtk4::CellView. 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 the Gnome::Gtk4::CellView becomes temporarily empty.

method set-displayed-row ( N-Object $path )
  • $path; a Gnome::Gtk4::N-TreePath or undefined to unset.

set-draw-sensitive

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Sets whether $cell-view should draw all of its cells in a sensitive state, this is used by Gnome::Gtk4::ComboBox menus to ensure that rows with insensitive cells that contain children appear sensitive in the parent menu item.

method set-draw-sensitive ( Bool() $draw-sensitive )
  • $draw-sensitive; whether to draw all cells in a sensitive state..

set-fit-model

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Sets whether $cell-view should request space to fit the entire Gnome::Gtk4::R-TreeModel.

This is used by Gnome::Gtk4::ComboBox to ensure that the cell view displayed on the combo box’s button always gets enough space and does not resize when selection changes.

method set-fit-model ( Bool() $fit-model )
  • $fit-model; whether $cell-view should request space for the whole model..

set-model

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Sets the model for $cell-view. If $cell-view already has a model set, it will remove it before setting the new model. If $model is undefined, then it will unset the old model.

method set-model ( N-Object() $model )
  • $model; a Gnome::Gtk4::R-TreeModel.