CellViewProtocol
public protocol CellViewProtocol : CellLayoutProtocol, OrientableProtocol, WidgetProtocol
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 eachother (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
GtkCellViewinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
cell_view_ptrDefault implementationTyped pointer to the underlying
GtkCellViewinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkCellViewinstance.Declaration
Swift
var cell_view_ptr: UnsafeMutablePointer<GtkCellView>! { get } -
Required Initialiser for types conforming to
CellViewProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
CellViewPropertyNamesource 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 : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a CellView property
Declaration
Swift
@inlinable func get(property: CellViewPropertyName) -> GLibObject.ValueParameters
propertythe 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
propertythe property to get the value for
Return Value
the value of the named property
-
getDisplayedRow()Extension methodReturns a
GtkTreePathreferring to the currently displayed row. If no row is currently displayed,nilis returned.Declaration
Swift
@inlinable func getDisplayedRow() -> TreePathRef! -
getDrawSensitive()Extension methodGets whether
cell_viewis configured to draw all of its cells in a sensitive state.Declaration
Swift
@inlinable func getDrawSensitive() -> Bool -
getFitModel()Extension methodGets whether
cell_viewis 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 usednilis returned.Declaration
Swift
@inlinable func getModel() -> TreeModelRef! -
getSizeOfRow(path:Extension methodrequisition: ) Sets
requisitionto the size needed bycell_viewto display the model row pointed to bypath.get_size_of_row is deprecated: Combo box formerly used this to calculate the sizes for cellviews, now you can achieve this by either using the #GtkCellView:fit-model property or by setting the currently displayed row of the #GtkCellView and using gtk_widget_get_preferred_size().
Declaration
Swift
@available(*, deprecated) @inlinable func getSizeOfRow<RequisitionT, TreePathT>(path: TreePathT, requisition: RequisitionT) -> Bool where RequisitionT : RequisitionProtocol, TreePathT : TreePathProtocol -
setBackground(color:Extension method) Sets the background color of
view.set_background_color is deprecated: Use gtk_cell_view_set_background_rgba() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func setBackground<ColorT>(color: ColorT) where ColorT : ColorProtocol -
setBackground(rgba:Extension method) Sets the background color of
cell_view.Declaration
Swift
@inlinable func setBackground<RGBAT>(rgba: RGBAT) where RGBAT : RGBAProtocol -
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 theGtkCellViewbecomes 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 theGtkCellViewbecomes temporarily empty.Declaration
Swift
@inlinable func setDisplayedRow<TreePathT>(path: TreePathT?) where TreePathT : TreePathProtocol -
set(drawSensitive:Extension method) 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.Declaration
Swift
@inlinable func set(drawSensitive: Bool) -
set(fitModel:Extension method) 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.Declaration
Swift
@inlinable func set(fitModel: Bool) -
set(model:Extension method) Sets the model for
cell_view. Ifcell_viewalready has a model set, it will remove it before setting the new model. Ifmodelisnil, 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_viewalready has a model set, it will remove it before setting the new model. Ifmodelisnil, then it will unset the old model.Declaration
Swift
@inlinable func set<TreeModelT>(model: TreeModelT?) where TreeModelT : TreeModelProtocol -
displayedRowExtension methodReturns a
GtkTreePathreferring to the currently displayed row. If no row is currently displayed,nilis returned.Declaration
Swift
@inlinable var displayedRow: TreePathRef! { get nonmutating set } -
drawSensitiveExtension methodGets whether
cell_viewis configured to draw all of its cells in a sensitive state.Declaration
Swift
@inlinable var drawSensitive: Bool { get nonmutating set } -
fitModelExtension methodGets whether
cell_viewis configured to request space to fit the entireGtkTreeModel.Declaration
Swift
@inlinable var fitModel: Bool { get nonmutating set } -
modelExtension methodThe model for cell view
since 2.10
Declaration
Swift
@inlinable var model: TreeModelRef! { get nonmutating set } -
parentInstanceExtension methodUndocumented
Declaration
Swift
@inlinable var parentInstance: GtkWidget { get }
View on GitHub
Install in Dash
CellViewProtocol Protocol Reference