## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

## Index

Package: Cell_Renderer

- Goto spec source

# Description

    package Gtk.Cell_Renderer is

The Gtk_Cell_Renderer is a base class of a set of objects used for rendering a cell to a Gdk_Drawable. These objects are used primarily by the Gtk_Tree_View widget, though they aren't tied to them in any specific way.

It is worth noting that Gtk_Cell_Renderer is not a Gtk_Widget and cannot be treated as such.

The primary use of a Gtk_Cell_Renderer is for drawing a certain graphical elements on a Gdk_Drawable. Typically, one cell renderer is used to draw many cells on the screen. To this extent, it isn't expected that Cell_Renderer keep any permanent state around. Instead, any state is set just prior to use using GObjects property system. Then, the cell is measured using Get_Size(). Finally, the cell is rendered in the correct location using Render().

There are a number of rules that must be followed when writing a new Gtk_Cell_Renderer. First and formost, it's important that a certain set of properties will always yield a cell renderer of the same size, barring GtkStyle change. The Gtk_Cell_Renderer also has a number of generic properties that are expected to be honored by all children.

Beyond merely rendering a cell, cell renderers can optionally provide active user interface elements. A cell renderer can be activatable like Gtk_Cell_Renderer_Toggle, which toggles when it gets activated by a mouse click, or it can be editable like Gtk_Cell_Renderer_Text, which allows the user to edit the text using a Gtk_Entry. To make a cell renderer activatable or editable, you have to implement the activate or start_editing virtual functions, respectively.

Binding from C File version 2.14

# Packages

### Cell_Renderer_List (new Glib.Glist.Generic_List)

    package Cell_Renderer_List is
          new Glib.Glist.Generic_List (Gtk_Cell_Renderer);

### Cell_Renderer_Mode_Properties (new Glib.Generic_Properties.Generic_Internal_Discrete_Property)

    package Cell_Renderer_Mode_Properties is new
         Glib.Generic_Properties.Generic_Internal_Discrete_Property
           (Gtk_Cell_Renderer_Mode);

# Classes

### Gtk_Cell_Renderer_Record

- Goto declaration in source
- Goto full declaration in source

    type Gtk_Cell_Renderer_Record is
         new Glib.Object.GObject_Record with private;

#### Ancestors:

Glib.Object.GObject_Record

#### Immediate Children:

Gtk.Cell_Renderer_Pixbuf.Gtk_Cell_Renderer_Pixbuf_Record
Gtk.Cell_Renderer_Progress.Gtk_Cell_Renderer_Progress_Record
Gtk.Cell_Renderer_Text.Gtk_Cell_Renderer_Text_Record
Gtk.Cell_Renderer_Toggle.Gtk_Cell_Renderer_Toggle_Record

#### Primitive operations:

Activate

- To API doc
- To spec

Get_Fixed_Size

- To API doc
- To spec

Get_Size

- To API doc
- To spec

Glib.Object.Deallocate

- To API doc
- To spec

(Inherited)
Glib.Object.Get_Type

- To API doc
- To spec

(Inherited)
Glib.Object.Notify

- To API doc
- To spec

(Inherited)
Glib.Object.Ref

- To API doc
- To spec

(Inherited)
Glib.Object.Ref_Sink

- To API doc
- To spec

(Inherited)
Glib.Object.Unref

- To API doc
- To spec

(Inherited)
Render

- To API doc
- To spec

Set_Fixed_Size

- To API doc
- To spec

Start_Editing

- To API doc
- To spec

# Types

### Gtk_Cell_Renderer

- Goto declaration in source

    type Gtk_Cell_Renderer is access all Gtk_Cell_Renderer_Record'Class;

### Gtk_Cell_Renderer_State

- Goto declaration in source

    type Gtk_Cell_Renderer_State is mod 2 ** 32;

### Gtk_Cell_Renderer_Mode

- Goto declaration in source

    type Gtk_Cell_Renderer_Mode is
         (Cell_Renderer_Mode_Inert,
          Cell_Renderer_Mode_Activatable,
          Cell_Renderer_Mode_Editable);

### Property_Cell_Renderer_Mode

- Goto declaration in source

    type Property_Cell_Renderer_Mode is
         new Cell_Renderer_Mode_Properties.Property;

# Constants & Global variables

### Cell_Renderer_Selected

- Goto declaration in source

(Gtk_Cell_Renderer_State)

    Cell_Renderer_Selected    : constant Gtk_Cell_Renderer_State;

### Cell_Renderer_Prelit

- Goto declaration in source

(Gtk_Cell_Renderer_State)

    Cell_Renderer_Prelit      : constant Gtk_Cell_Renderer_State;

### Cell_Renderer_Insensitive

- Goto declaration in source

(Gtk_Cell_Renderer_State)

    Cell_Renderer_Insensitive : constant Gtk_Cell_Renderer_State;

### Cell_Renderer_Sorted

- Goto declaration in source

(Gtk_Cell_Renderer_State)

    Cell_Renderer_Sorted      : constant Gtk_Cell_Renderer_State;

### Cell_Renderer_Focused

- Goto declaration in source

(Gtk_Cell_Renderer_State)

    Cell_Renderer_Focused     : constant Gtk_Cell_Renderer_State;

Identifies how a cell should be renderer. Prelit is used when the mouse is hovering over a particular cell. Sorted is used when the cell is in a sort row.

### Signal_Editing_Canceled

- Goto declaration in source

(Glib.Signal_Name)

    Signal_Editing_Canceled : constant Glib.Signal_Name := "editing-canceled";

### Signal_Editing_Started

- Goto declaration in source

(Glib.Signal_Name)

    Signal_Editing_Started  : constant Glib.Signal_Name := "editing-started";

### Cell_Background_Property

- Goto declaration in source

(Glib.Properties.Property_String)

    Cell_Background_Property     : constant Glib.Properties.Property_String;

Cell_Background_Gdk_Property : constant Glib.Properties.Property_Boxed;

### Editing_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Editing_Property             : constant Glib.Properties.Property_Boolean;

Cell_Background_Gdk_Property : constant Glib.Properties.Property_Boxed;

### Height_Property

- Goto declaration in source

(Glib.Properties.Property_Int)

    Height_Property              : constant Glib.Properties.Property_Int;

### Is_Expanded_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Is_Expanded_Property         : constant Glib.Properties.Property_Boolean;

### Is_Expander_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Is_Expander_Property         : constant Glib.Properties.Property_Boolean;

### Mode_Property

- Goto declaration in source

(Property_Cell_Renderer_Mode)

    Mode_Property                : constant Property_Cell_Renderer_Mode;

### Sensitive_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Sensitive_Property           : constant Glib.Properties.Property_Boolean;

### Visible_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Visible_Property             : constant Glib.Properties.Property_Boolean;

### Width_Property

- Goto declaration in source

(Glib.Properties.Property_Int)

    Width_Property               : constant Glib.Properties.Property_Int;

### Xalign_Property

- Goto declaration in source

(Glib.Properties.Property_Float)

    Xalign_Property              : constant Glib.Properties.Property_Float;

### Xpad_Property

- Goto declaration in source

(Glib.Properties.Property_Uint)

    Xpad_Property                : constant Glib.Properties.Property_Uint;

### Yalign_Property

- Goto declaration in source

(Glib.Properties.Property_Float)

    Yalign_Property              : constant Glib.Properties.Property_Float;

### Ypad_Property

- Goto declaration in source

(Glib.Properties.Property_Uint)

    Ypad_Property                : constant Glib.Properties.Property_Uint;

# Subprograms & Entries

### Convert

- Goto spec in source

    function Convert (R: Gtk_Cell_Renderer) return System.Address;

### Convert

- Goto spec in source

    function Convert (R: System.Address) return Gtk_Cell_Renderer;

### Get_Type

- Goto spec in source
- Goto body in source

    function Get_Type return GType;

Return the internal value associated with Gtk_Cell_Renderer

### Get_Size

- Goto spec in source

    procedure Get_Size (Cell: access Gtk_Cell_Renderer_Record;Widget: access Gtk.Widget.Gtk_Widget_Record'Class;Cell_Area: out Gdk.Rectangle.Gdk_Rectangle;X_Offset: out Gint;Y_Offset: out Gint;Width: out Gint;Height: out Gint);

Obtain the width and height needed to render the cell. Used by view widgets to determine the appropriate size for the Cell_Area passed to Render. Fill in the x and y offsets (if set) of the cell relative to this location. Please note that the values set in Width and Height, as well as those in X_Offset and Y_Offset are inclusive of the Xpad and Ypad properties. Widget: the widget the renderer is rendering to. Cell_Area: The area a cell will be allocated. X_Offset: X offset of cell relative to Cell_Area. Y_Offset: Y offset of cell relative to Cell_Area. Width: Width needed to render a cell. Height: Height needed to render a cell.

### Render

- Goto spec in source

    procedure Render (Cell: access Gtk_Cell_Renderer_Record;Window: Gdk.Window.Gdk_Window;Widget: access Gtk.Widget.Gtk_Widget_Record'Class;Background_Area: Gdk.Rectangle.Gdk_Rectangle;Cell_Area: Gdk.Rectangle.Gdk_Rectangle;Expose_Area: Gdk.Rectangle.Gdk_Rectangle;Flags: Gtk_Cell_Renderer_State);

Invokes the virtual render function of the Gtk_Cell_Renderer. The three passed-in rectangles are areas of Window. Most renderers will draw within Cell_Area; the Xalign, Yalign, Xpad, and Ypad fields of the GtkCellRenderer should be honored with respect to Cell_Area. Background_Area includes the blank space around the cell, and also the area containing the tree expander; so the Background_Area rectangles for all cells tile to cover the entire Window. Expose_Area is a clip rectangle.

### Activate

- Goto spec in source

    function Activate (Cell: access Gtk_Cell_Renderer_Record;Event: Gdk.Event.Gdk_Event;Widget: access Gtk.Widget.Gtk_Widget_Record'Class;Path: UTF8_String;Background_Area: Gdk.Rectangle.Gdk_Rectangle;Cell_Area: Gdk.Rectangle.Gdk_Rectangle;Flags: Gtk_Cell_Renderer_State) return Boolean;

Passes an activate event to the cell renderer for possible processing. Some cell renderers may use events; for example, Gtk_Cell_Renderer_Toggle toggles when it gets a mouse click.

### Start_Editing

- Goto spec in source

    function Start_Editing (Cell: access Gtk_Cell_Renderer_Record;Event: Gdk.Event.Gdk_Event;Widget: access Gtk.Widget.Gtk_Widget_Record'Class;Path: UTF8_String;Background_Area: Gdk.Rectangle.Gdk_Rectangle;Cell_Area: Gdk.Rectangle.Gdk_Rectangle;Flags: Gtk_Cell_Renderer_State) return Gtk.Cell_Editable.Gtk_Cell_Editable;

Passes an activate event to the cell renderer for possible processing. Cell: a Gtk_Cell_Renderer Event: a Gdk_Event Widget: widget that received the event Path: widget-dependent string representation of the event location; e.g. for Gtk_Tree_View, a string representation of Gtk_Tree_Path Background_Area: background area as passed to Render Cell_Area: cell area as passed to Render

### Set_Fixed_Size

- Goto spec in source

    procedure Set_Fixed_Size (Cell: access Gtk_Cell_Renderer_Record;Width: Gint;Height: Gint);

### Get_Fixed_Size

- Goto spec in source

    procedure Get_Fixed_Size (Cell: access Gtk_Cell_Renderer_Record;Width: out Gint;Height: out Gint);

Sets the renderer size to be explicit, independent of the properties set.