CellViewProtocol
public protocol CellViewProtocol : CellLayoutProtocol, OrientableProtocol, WidgetProtocol
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.
The CellViewProtocol
protocol exposes the methods and properties of an underlying GtkCellView
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see CellView
.
Alternatively, use CellViewRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkCellView
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
cell_view_ptr
Default implementationTyped pointer to the underlying
GtkCellView
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkCellView
instance.Declaration
Swift
var cell_view_ptr: UnsafeMutablePointer<GtkCellView>! { get }
-
Required Initialiser for types conforming to
CellViewProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
CellViewPropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: CellViewPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a CellView property
Declaration
Swift
@inlinable func get(property: CellViewPropertyName) -> GLibObject.Value
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
set(property:
Extension methodvalue: ) Set the value of a CellView property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: CellViewPropertyName, value v: GLibObject.Value)
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
getDisplayedRow()
Extension methodReturns a
GtkTreePath
referring to the currently displayed row. If no row is currently displayed,nil
is returned.Declaration
Swift
@inlinable func getDisplayedRow() -> TreePathRef!
-
getDrawSensitive()
Extension methodGets whether
cell_view
is configured to draw all of its cells in a sensitive state.Declaration
Swift
@inlinable func getDrawSensitive() -> Bool
-
getFitModel()
Extension methodGets whether
cell_view
is configured to request space to fit the entireGtkTreeModel
.Declaration
Swift
@inlinable func getFitModel() -> Bool
-
getModel()
Extension methodReturns the model for
cell_view
. If no model is usednil
is returned.Declaration
Swift
@inlinable func getModel() -> TreeModelRef!
-
setDisplayedRow(path:
Extension method) 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.Declaration
Swift
@inlinable func setDisplayedRow(path: TreePathRef? = nil)
-
setDisplayedRow(path:
Extension method) 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.Declaration
Swift
@inlinable func setDisplayedRow<TreePathT>(path: TreePathT?) where TreePathT : TreePathProtocol
-
set(drawSensitive:
Extension method) Sets whether
cell_view
should draw all of its cells in a sensitive state, this is used byGtkComboBox
menus to ensure that rows with insensitive cells that contain children appear sensitive in the parent menu item.Declaration
Swift
@inlinable func set(drawSensitive: Bool)
-
set(fitModel:
Extension method) Sets whether
cell_view
should request space to fit the entireGtkTreeModel
.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.Declaration
Swift
@inlinable func set(fitModel: Bool)
-
set(model:
Extension method) Sets the model for
cell_view
. Ifcell_view
already has a model set, it will remove it before setting the new model. Ifmodel
isnil
, then it will unset the old model.Declaration
Swift
@inlinable func set(model: TreeModelRef? = nil)
-
set(model:
Extension method) Sets the model for
cell_view
. Ifcell_view
already has a model set, it will remove it before setting the new model. Ifmodel
isnil
, then it will unset the old model.Declaration
Swift
@inlinable func set<TreeModelT>(model: TreeModelT?) where TreeModelT : TreeModelProtocol
-
displayedRow
Extension methodReturns a
GtkTreePath
referring to the currently displayed row. If no row is currently displayed,nil
is returned.Declaration
Swift
@inlinable var displayedRow: TreePathRef! { get nonmutating set }
-
drawSensitive
Extension methodGets whether
cell_view
is configured to draw all of its cells in a sensitive state.Declaration
Swift
@inlinable var drawSensitive: Bool { get nonmutating set }
-
fitModel
Extension methodGets whether
cell_view
is configured to request space to fit the entireGtkTreeModel
.Declaration
Swift
@inlinable var fitModel: Bool { get nonmutating set }
-
model
Extension methodThe model for cell view
since 2.10
Declaration
Swift
@inlinable var model: TreeModelRef! { get nonmutating set }