Gtk.CellView¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.CellLayout (9), Gtk.Orientable (2)
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
|||
r/w/co |
|||
r/w/en |
|||
r/w/en |
|||
r/w |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.CellView(**kwargs)¶
- Bases:
- Abstract:
No
A widget displaying a single row of a
Gtk.TreeModel
A
GtkCellView
displays a single row of aGtkTreeModel
using aGtkCellArea
andGtkCellAreaContext
. AGtkCellAreaContext
can be provided to theGtkCellView
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 ofGtkComboBox
).GtkCellView
isGtkOrientable
in order to decide in which orientation the underlyingGtkCellAreaContext
should be allocated. Taking theGtkComboBox
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
Gtk.CellView
has a single CSS node with name cellview.Deprecated since version 4.10: List views use widgets to display their contents. You can use [class`Gtk`.Box] instead
- classmethod new()[source]¶
- Returns:
A newly created
GtkCellView
widget.- Return type:
Creates a new
GtkCellView
widget.Deprecated since version 4.10.
- classmethod new_with_context(area, context)[source]¶
- Parameters:
area (
Gtk.CellArea
) – theGtkCellArea
to layout cellscontext (
Gtk.CellAreaContext
) – theGtkCellAreaContext
in which to calculate cell geometry
- Returns:
A newly created
GtkCellView
widget.- Return type:
Creates a new
GtkCellView
widget with a specificGtkCellArea
to 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.
- classmethod new_with_markup(markup)[source]¶
- Parameters:
markup (
str
) – the text to display in the cell view- Returns:
A newly created
GtkCellView
widget.- Return type:
Creates a new
GtkCellView
widget, adds aGtkCellRendererText
to it, and makes it show markup. The text can be marked up with the Pango text markup language.Deprecated since version 4.10.
- classmethod new_with_text(text)[source]¶
- Parameters:
text (
str
) – the text to display in the cell view- Returns:
A newly created
GtkCellView
widget.- Return type:
Creates a new
GtkCellView
widget, adds aGtkCellRendererText
to it, and makes it show text.Deprecated since version 4.10.
- classmethod new_with_texture(texture)[source]¶
- Parameters:
texture (
Gdk.Texture
) – the image to display in the cell view- Returns:
A newly created
GtkCellView
widget.- Return type:
Creates a new
GtkCellView
widget, adds aGtkCellRendererPixbuf
to it, and makes it show texture.Deprecated since version 4.10.
- get_displayed_row()[source]¶
- Returns:
the currently displayed row
- Return type:
Gtk.TreePath
orNone
Returns a
GtkTreePath
referring to the currently displayed row. If no row is currently displayed,None
is returned.Deprecated since version 4.10.
- get_draw_sensitive()[source]¶
- Returns:
whether self draws all of its cells in a sensitive state
- Return type:
Gets whether self is configured to draw all of its cells in a sensitive state.
Deprecated since version 4.10.
- get_fit_model()[source]¶
- Returns:
whether self requests space to fit the entire
GtkTreeModel
.- Return type:
Gets whether self is configured to request space to fit the entire
GtkTreeModel
.Deprecated since version 4.10.
- get_model()[source]¶
- Returns:
a
GtkTreeModel
used- Return type:
Returns the model for self. If no model is used
None
is returned.Deprecated since version 4.10.
- set_displayed_row(path)[source]¶
- Parameters:
path (
Gtk.TreePath
orNone
) – aGtkTreePath
orNone
to unset.
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 theGtkCellView
becomes temporarily empty.Deprecated since version 4.10.
- set_draw_sensitive(draw_sensitive)[source]¶
- Parameters:
draw_sensitive (
bool
) – whether to draw all cells in a sensitive state.
Sets whether self should draw all of its cells in a sensitive state, this is used by
GtkComboBox
menus to ensure that rows with insensitive cells that contain children appear sensitive in the parent menu item.Deprecated since version 4.10.
- set_fit_model(fit_model)[source]¶
- Parameters:
fit_model (
bool
) – whether self should request space for the whole model.
Sets whether self should request space to fit the entire
GtkTreeModel
.This is used by
GtkComboBox
to 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.
- set_model(model)[source]¶
- Parameters:
model (
Gtk.TreeModel
orNone
) – aGtkTreeModel
Sets the model for self. If self already has a model set, it will remove it before setting the new model. If model is
None
, then it will unset the old model.Deprecated since version 4.10.
Property Details¶
- Gtk.CellView.props.cell_area¶
- Name:
cell-area
- Type:
- Default Value:
- Flags:
The
GtkCellArea
rendering cellsIf no area is specified when creating the cell view with
Gtk.CellView.new_with_context
() a horizontally oriented ``GtkCellArea``Box will be used.since 3.0
- Gtk.CellView.props.cell_area_context¶
- Name:
cell-area-context
- Type:
- Default Value:
- Flags:
The
GtkCellAreaContext
used to compute the geometry of the cell view.A group of cell views can be assigned the same context in order to ensure the sizes and cell alignments match across all the views with the same context.
GtkComboBox
menus uses this to assign the same context to all cell views in the menu items for a single menu (each submenu creates its own context since the size of each submenu does not depend on parent or sibling menus).since 3.0
- Gtk.CellView.props.draw_sensitive¶
- Name:
draw-sensitive
- Type:
- Default Value:
- Flags:
Whether all cells should be draw as sensitive for this view regardless of the actual cell properties (used to make menus with submenus appear sensitive when the items in submenus might be insensitive).
since 3.0
- Gtk.CellView.props.fit_model¶
- Name:
fit-model
- Type:
- Default Value:
- Flags:
Whether the view should request enough space to always fit the size of every row in the model (used by the combo box to ensure the combo box size doesn’t change when different items are selected).
since 3.0
- Gtk.CellView.props.model¶
- Name:
model
- Type:
- Default Value:
- Flags:
The model for cell view
since 2.10