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.
function "+"
(Widget : access Gtk_Cell_View_Record'Class)
return Gtk.Accessible.Gtk_Accessible
function "+"
(Widget : access Gtk_Cell_View_Record'Class)
return Gtk.Buildable.Gtk_Buildable
function "+"
(Widget : access Gtk_Cell_View_Record'Class)
return Gtk.Cell_Layout.Gtk_Cell_Layout
function "+"
(Widget : access Gtk_Cell_View_Record'Class)
return Gtk.Constraint_Target.Gtk_Constraint_Target
function "+"
(Widget : access Gtk_Cell_View_Record'Class)
return Gtk.Orientable.Gtk_Orientable
function "-"
(Interf : Gtk.Accessible.Gtk_Accessible)
return Gtk_Cell_View
function "-"
(Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Cell_View
function "-"
(Interf : Gtk.Cell_Layout.Gtk_Cell_Layout)
return Gtk_Cell_View
function "-"
(Interf : Gtk.Constraint_Target.Gtk_Constraint_Target)
return Gtk_Cell_View
function "-"
(Interf : Gtk.Orientable.Gtk_Orientable)
return Gtk_Cell_View
procedure Add_Attribute
(Self : not null access Gtk_Cell_View_Record;
Cell : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Attribute : UTF8_String;
Column : Glib.Gint)
procedure Announce
(Self : not null access Gtk_Cell_View_Record;
Message : UTF8_String;
Priority : Gtk.Accessible.Gtk_Accessible_Announcement_Priority)
Cell_Area_Context_Property : constant Glib.Properties.Property_Object;
Type: Gtk.Cell_Area_Context.Gtk_Cell_Area_Context 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
Cell_Area_Property : constant Glib.Properties.Property_Object;
Type: Gtk.Cell_Area.Gtk_Cell_Area The GtkCellArea rendering cells
If no area is specified when creating the cell view with Gtk.Cell_View.Gtk_New_With_Context a horizontally oriented GtkCellAreaBox will be used.
since 3.0
procedure Clear (Self : not null access Gtk_Cell_View_Record)
procedure Clear_Attributes
(Self : not null access Gtk_Cell_View_Record;
Cell : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class)
Draw_Sensitive_Property : constant Glib.Properties.Property_Boolean;
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
Fit_Model_Property : constant Glib.Properties.Property_Boolean;
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
function Get_Accessible_Id
(Self : not null access Gtk_Cell_View_Record) return UTF8_String
function Get_Accessible_Parent
(Self : not null access Gtk_Cell_View_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Accessible_Role
(Self : not null access Gtk_Cell_View_Record)
return Gtk.Accessible.Gtk_Accessible_Role
function Get_At_Context
(Self : not null access Gtk_Cell_View_Record)
return Gtk.Atcontext.Gtk_Atcontext
function Get_Bounds
(Self : not null access Gtk_Cell_View_Record;
X : out Glib.Gint;
Y : out Glib.Gint;
Width : out Glib.Gint;
Height : out Glib.Gint) return Boolean
function Get_Cells
(Self : not null access Gtk_Cell_View_Record)
return Gtk.Cell_Renderer.Cell_Renderer_List.Glist
function Get_Displayed_Row
(Self : not null access Gtk_Cell_View_Record)
return Gtk.Tree_Model.Gtk_Tree_Path
Returns a GtkTreePath referring to the currently displayed row. If no row is currently displayed, null is returned. Deprecated since 4.10, 1
the currently displayed row. Has transfer-ownership='full'.
function Get_Draw_Sensitive
(Self : not null access Gtk_Cell_View_Record) return Boolean
Gets whether Cell_View is configured to draw all of its cells in a sensitive state. Deprecated since 4.10, 1
whether Cell_View draws all of its cells in a sensitive state
function Get_First_Accessible_Child
(Self : not null access Gtk_Cell_View_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Fit_Model
(Self : not null access Gtk_Cell_View_Record) return Boolean
Gets whether Cell_View is configured to request space to fit the entire GtkTreeModel. Deprecated since 4.10, 1
whether Cell_View requests space to fit the entire GtkTreeModel.
function Get_Model
(Self : not null access Gtk_Cell_View_Record)
return Gtk.Tree_Model.Gtk_Tree_Model
Returns the model for Cell_View. If no model is used null is returned. Deprecated since 4.10, 1
a GtkTreeModel used
function Get_Next_Accessible_Sibling
(Self : not null access Gtk_Cell_View_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Orientation
(Self : not null access Gtk_Cell_View_Record)
return Gtk.Enums.Gtk_Orientation
function Get_Platform_State
(Self : not null access Gtk_Cell_View_Record;
State : Gtk.Accessible.Gtk_Accessible_Platform_State) return Boolean
function Get_Type return Glib.GType
type Gtk_Cell_Layout_Data_Func is access procedure
(Cell_Layout : Gtk.Cell_Layout.Gtk_Cell_Layout;
Cell : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Tree_Model : Gtk.Tree_Model.Gtk_Tree_Model;
Iter : Gtk.Tree_Model.Gtk_Tree_Iter);
A function which should set the value of Cell_Layout's cell renderer(s) as appropriate.
a GtkCellLayout
the cell renderer whose value is to be set
the model
a GtkTreeIter indicating the row to set the value for
type Gtk_Cell_View is access all Gtk_Cell_View_Record'Class;
function Gtk_Cell_View_New return Gtk_Cell_View
Creates a new GtkCellView widget.
function Gtk_Cell_View_New_With_Context
(Area : not null access Gtk.Cell_Area.Gtk_Cell_Area_Record'Class;
Context : not null access Gtk.Cell_Area_Context.Gtk_Cell_Area_Context_Record'Class)
return Gtk_Cell_View
Creates a new GtkCellView widget with a specific GtkCellArea to layout cells and a specific GtkCellAreaContext. 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.
the GtkCellArea to layout cells
the GtkCellAreaContext in which to calculate cell geometry
function Gtk_Cell_View_New_With_Markup
(Markup : UTF8_String) return Gtk_Cell_View
Creates a new GtkCellView widget, adds a GtkCellRendererText to it, and makes it show Markup. The text can be marked up with the Pango text markup language.
the text to display in the cell view
function Gtk_Cell_View_New_With_Text
(Text : UTF8_String) return Gtk_Cell_View
Creates a new GtkCellView widget, adds a GtkCellRendererText to it, and makes it show Text.
the text to display in the cell view
function Gtk_Cell_View_New_With_Texture
(Texture : not null access Gdk.Texture.Gdk_Texture_Record'Class)
return Gtk_Cell_View
Creates a new GtkCellView widget, adds a GtkCellRendererPixbuf to it, and makes it show Texture.
the image to display in the cell view
type Gtk_Cell_View_Record is new Gtk_Widget_Record with null record;
procedure Gtk_New (Self : out Gtk_Cell_View)
Creates a new GtkCellView widget. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
procedure Gtk_New_With_Context
(Self : out Gtk_Cell_View;
Area : not null access Gtk.Cell_Area.Gtk_Cell_Area_Record'Class;
Context : not null access Gtk.Cell_Area_Context.Gtk_Cell_Area_Context_Record'Class)
Creates a new GtkCellView widget with a specific GtkCellArea to layout cells and a specific GtkCellAreaContext. 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. Initialize_With_Context does nothing if the object was already created with another call to Initialize* or G_New.
the GtkCellArea to layout cells
the GtkCellAreaContext in which to calculate cell geometry
procedure Gtk_New_With_Markup
(Self : out Gtk_Cell_View;
Markup : UTF8_String)
Creates a new GtkCellView widget, adds a GtkCellRendererText to it, and makes it show Markup. The text can be marked up with the Pango text markup language. Initialize_With_Markup does nothing if the object was already created with another call to Initialize* or G_New.
the text to display in the cell view
procedure Gtk_New_With_Text
(Self : out Gtk_Cell_View;
Text : UTF8_String)
Creates a new GtkCellView widget, adds a GtkCellRendererText to it, and makes it show Text. Initialize_With_Text does nothing if the object was already created with another call to Initialize* or G_New.
the text to display in the cell view
procedure Gtk_New_With_Texture
(Self : out Gtk_Cell_View;
Texture : not null access Gdk.Texture.Gdk_Texture_Record'Class)
Creates a new GtkCellView widget, adds a GtkCellRendererPixbuf to it, and makes it show Texture. Initialize_With_Texture does nothing if the object was already created with another call to Initialize* or G_New.
the image to display in the cell view
package Implements_Gtk_Accessible is new Glib.Types.Implements
(Gtk.Accessible.Gtk_Accessible, Gtk_Cell_View_Record, Gtk_Cell_View);
package Implements_Gtk_Buildable is new Glib.Types.Implements
(Gtk.Buildable.Gtk_Buildable, Gtk_Cell_View_Record, Gtk_Cell_View);
package Implements_Gtk_Cell_Layout is new Glib.Types.Implements
(Gtk.Cell_Layout.Gtk_Cell_Layout, Gtk_Cell_View_Record, Gtk_Cell_View);
package Implements_Gtk_Constraint_Target is new Glib.Types.Implements
(Gtk.Constraint_Target.Gtk_Constraint_Target, Gtk_Cell_View_Record, Gtk_Cell_View);
package Implements_Gtk_Orientable is new Glib.Types.Implements
(Gtk.Orientable.Gtk_Orientable, Gtk_Cell_View_Record, Gtk_Cell_View);
procedure Initialize (Self : not null access Gtk_Cell_View_Record'Class)
Creates a new GtkCellView widget. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
procedure Initialize_With_Context
(Self : not null access Gtk_Cell_View_Record'Class;
Area : not null access Gtk.Cell_Area.Gtk_Cell_Area_Record'Class;
Context : not null access Gtk.Cell_Area_Context.Gtk_Cell_Area_Context_Record'Class)
Creates a new GtkCellView widget with a specific GtkCellArea to layout cells and a specific GtkCellAreaContext. 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. Initialize_With_Context does nothing if the object was already created with another call to Initialize* or G_New.
the GtkCellArea to layout cells
the GtkCellAreaContext in which to calculate cell geometry
procedure Initialize_With_Markup
(Self : not null access Gtk_Cell_View_Record'Class;
Markup : UTF8_String)
Creates a new GtkCellView widget, adds a GtkCellRendererText to it, and makes it show Markup. The text can be marked up with the Pango text markup language. Initialize_With_Markup does nothing if the object was already created with another call to Initialize* or G_New.
the text to display in the cell view
procedure Initialize_With_Text
(Self : not null access Gtk_Cell_View_Record'Class;
Text : UTF8_String)
Creates a new GtkCellView widget, adds a GtkCellRendererText to it, and makes it show Text. Initialize_With_Text does nothing if the object was already created with another call to Initialize* or G_New.
the text to display in the cell view
procedure Initialize_With_Texture
(Self : not null access Gtk_Cell_View_Record'Class;
Texture : not null access Gdk.Texture.Gdk_Texture_Record'Class)
Creates a new GtkCellView widget, adds a GtkCellRendererPixbuf to it, and makes it show Texture. Initialize_With_Texture does nothing if the object was already created with another call to Initialize* or G_New.
the image to display in the cell view
Model_Property : constant Glib.Properties.Property_Interface;
Type: Gtk.Tree_Model.Gtk_Tree_Model The model for cell view
since 2.10
procedure Pack_End
(Self : not null access Gtk_Cell_View_Record;
Cell : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Expand : Boolean)
procedure Pack_Start
(Self : not null access Gtk_Cell_View_Record;
Cell : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Expand : Boolean)
procedure Reorder
(Self : not null access Gtk_Cell_View_Record;
Cell : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Position : Glib.Gint)
procedure Reset_Property
(Self : not null access Gtk_Cell_View_Record;
Property : Gtk.Accessible.Gtk_Accessible_Property)
procedure Reset_Relation
(Self : not null access Gtk_Cell_View_Record;
Relation : Gtk.Accessible.Gtk_Accessible_Relation)
procedure Reset_State
(Self : not null access Gtk_Cell_View_Record;
State : Gtk.Accessible.Gtk_Accessible_State)
procedure Set_Accessible_Parent
(Self : not null access Gtk_Cell_View_Record;
Parent : Gtk.Accessible.Gtk_Accessible;
Next_Sibling : Gtk.Accessible.Gtk_Accessible)
procedure Set_Cell_Data_Func
(Self : not null access Gtk_Cell_View_Record;
Cell : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
Func : Gtk_Cell_Layout_Data_Func)
Sets the GtkCellLayoutDataFunc to use for Cell_Layout. This function is used instead of the standard attributes mapping for setting the column value, and should set the value of Cell_Layout's cell renderer(s) as appropriate. Func may be null to remove a previously set function. Deprecated since 4.10, 1
a GtkCellRenderer
the GtkCellLayoutDataFunc to use
procedure Set_Displayed_Row
(Self : not null access Gtk_Cell_View_Record;
Path : Gtk.Tree_Model.Gtk_Tree_Path)
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 the GtkCellView becomes temporarily empty. Deprecated since 4.10, 1
a GtkTreePath or null to unset.
procedure Set_Draw_Sensitive
(Self : not null access Gtk_Cell_View_Record;
Draw_Sensitive : Boolean)
Sets whether Cell_View 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 4.10, 1
whether to draw all cells in a sensitive state.
procedure Set_Fit_Model
(Self : not null access Gtk_Cell_View_Record;
Fit_Model : Boolean)
Sets whether Cell_View 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 4.10, 1
whether Cell_View should request space for the whole model.
procedure Set_Model
(Self : not null access Gtk_Cell_View_Record;
Model : Gtk.Tree_Model.Gtk_Tree_Model)
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 null, then it will unset the old model. Deprecated since 4.10, 1
a GtkTreeModel
procedure Set_Orientation
(Self : not null access Gtk_Cell_View_Record;
Orientation : Gtk.Enums.Gtk_Orientation)
procedure Update_Next_Accessible_Sibling
(Self : not null access Gtk_Cell_View_Record;
New_Sibling : Gtk.Accessible.Gtk_Accessible)
procedure Update_Platform_State
(Self : not null access Gtk_Cell_View_Record;
State : Gtk.Accessible.Gtk_Accessible_Platform_State)