Gtk::CellArea Class Reference

An abstract base class for laying out CellRenderers. More...

Inheritance diagram for Gtk::CellArea:
[legend]

## Public Types

typedef sigc::slot< bool, CellRenderer* > | SlotForeach
| For instance, bool on_foreach(Gtk::CellRenderer* renderer);. More...
typedef sigc::slot< bool, CellRenderer*, const Gdk::Rectangle&, const Gdk::Rectangle& > | SlotForeachAlloc
| For instance, bool on_foreach(Gtk::CellRenderer* renderer, const Gdk::Rectangle& cell_area, const Gdk::Rectangle& background_area>);. More...
Public Types inherited from Gtk::CellLayout
typedef sigc::slot< void, const TreeModel::const_iterator& > | SlotCellData

## Public Member Functions

virtual | ~CellArea ()
GtkCellArea* | gobj ()
| Provides access to the underlying C GObject. More...
const GtkCellArea* | gobj () const
| Provides access to the underlying C GObject. More...
GtkCellArea* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
void | add (CellRenderer& renderer)
| Adds renderer to area with the default child cell properties. More...
void | remove (CellRenderer& renderer)
| Removes renderer from area. More...
bool | has_renderer (CellRenderer& renderer)
| Checks if area contains renderer. More...
void | foreach (const SlotForeach& slot)
| Calls the slot for every CellRenderer in the CellArea. More...
void | foreach (const Glib::RefPtr< CellAreaContext >& context, Widget* widget, const Gdk::Rectangle& cell_area, const Gdk::Rectangle& background_area, const SlotForeachAlloc& slot)
| Calls the slot for every CellRenderer in the CellArea with the allocated rectangle inside the cell_area rectangle. More...
int | event (const Glib::RefPtr< CellAreaContext >& context, Widget& widget, GdkEvent* event, const Gdk::Rectangle& cell_area, GtkCellRendererState flags)
| Delegates event handling to a Gtk::CellArea. More...
void | render (const Glib::RefPtr< CellAreaContext >& context, Widget& widget, const ::Cairo::RefPtr< ::Cairo::Context >& cr, const Gdk::Rectangle& background_area, const Gdk::Rectangle& cell_area, CellRendererState flags, bool paint_focus)
| Renders area's cells according to area's layout onto widget at the given coordinates. More...
void | get_cell_allocation (const Glib::RefPtr< CellAreaContext >& context, Widget& widget, CellRenderer& renderer, const Gdk::Rectangle& cell_area, Gdk::Rectangle& allocation)
| Derives the allocation of renderer inside area if area were to be renderered in cell_area. More...
CellRenderer* | get_cell_at_position (const Glib::RefPtr< CellAreaContext >& context, Widget& widget, const Gdk::Rectangle& cell_area, int x, int y, Gdk::Rectangle& alloc_area)
| Gets the Gtk::CellRenderer at x and y coordinates inside area and optionally returns the full cell allocation for it inside cell_area. More...
const CellRenderer* | get_cell_at_position (const Glib::RefPtr< CellAreaContext >& context, Widget& widget, const Gdk::Rectangle& cell_area, int x, int y, Gdk::Rectangle& alloc_area) const
| Gets the Gtk::CellRenderer at x and y coordinates inside area and optionally returns the full cell allocation for it inside cell_area. More...
Glib::RefPtr< CellAreaContext > | create_context () const
| Creates a Gtk::CellAreaContext to be used with area for all purposes. More...
Glib::RefPtr< CellAreaContext > | copy_context (const Glib::RefPtr< const CellAreaContext >& context)
| This is sometimes needed for cases where rows need to share alignments in one orientation but may be separately grouped in the opposing orientation. More...
SizeRequestMode | get_request_mode () const
| Gets whether the area prefers a height-for-width layout or a width-for-height layout. More...
void | get_preferred_width (const Glib::RefPtr< CellAreaContext >& context, Widget& widget, int& minimum_width, int& natural_width)
| Retrieves a cell area's initial minimum and natural width. More...
void | get_preferred_height_for_width (const Glib::RefPtr< CellAreaContext >& context, Widget& widget, int width, int& minimum_height, int& natural_height)
| Retrieves a cell area's minimum and natural height if it would be given the specified width. More...
void | get_preferred_height (const Glib::RefPtr< CellAreaContext >& context, Widget& widget, int& minimum_height, int& natural_height)
| Retrieves a cell area's initial minimum and natural height. More...
void | get_preferred_width_for_height (const Glib::RefPtr< CellAreaContext >& context, Widget& widget, int height, int& minimum_width, int& natural_width)
| Retrieves a cell area's minimum and natural width if it would be given the specified height. More...
Glib::ustring | get_current_path_string () const
| Gets the current Gtk::TreePath string for the currently applied Gtk::TreeIter, this is implicitly updated when apply_attributes() is called and can be used to interact with renderers from Gtk::CellArea subclasses. More...
void | apply_attributes (const Glib::RefPtr< TreeModel >& tree_model, const TreeModel::iterator& iter, bool is_expander, bool is_expanded)
| Applies any connected attributes to the renderers in area by pulling the values from tree_model. More...
void | attribute_connect (CellRenderer& renderer, const Glib::ustring& attribute, int column)
| Connects an attribute to apply values from column for the Gtk::TreeModel in use. More...
void | attribute_disconnect (CellRenderer& renderer, const Glib::ustring& attribute)
| Disconnects attribute for the renderer in area so that attribute will no longer be updated with values from the model. More...
void | cell_set_property (CellRenderer& renderer, const Glib::ustring& property_name, const Glib::ValueBase& value)
| Sets a cell property for renderer in area. More...
void | cell_get_property (CellRenderer& renderer, const Glib::ustring& property_name, Glib::ValueBase& value)
| Gets the value of a cell property for renderer in area. More...
bool | is_activatable () const
| Returns whether the area can do anything when activated, after applying new attributes to area. More...
bool | activate (const Glib::RefPtr< CellAreaContext >& context, Widget& widget, const Gdk::Rectangle& cell_area, CellRendererState flags, bool edit_only)
| Activates area, usually by activating the currently focused cell, however some subclasses which embed widgets in the area can also activate a widget if it currently has the focus. More...
bool | focus (DirectionType direction)
| This should be called by the area's owning layout widget when focus is to be passed to area, or moved within area for a given direction and row data. More...
void | set_focus_cell (CellRenderer& renderer)
| Explicitly sets the currently focused cell to renderer. More...
CellRenderer* | get_focus_cell ()
| Retrieves the currently focused cell for area. More...
const CellRenderer* | get_focus_cell () const
| Retrieves the currently focused cell for area. More...
void | add_focus_sibling (CellRenderer& renderer, CellRenderer& sibling)
| Adds sibling to renderer's focusable area, focus will be drawn around renderer and all of its siblings if renderer can focus for a given row. More...
void | remove_focus_sibling (CellRenderer& renderer, CellRenderer& sibling)
| Removes sibling from renderer's focus sibling list (see add_focus_sibling()). More...
bool | is_focus_sibling (CellRenderer& renderer, CellRenderer& sibling)
| Returns whether sibling is one of renderer's focus siblings (see add_focus_sibling()). More...
std::vector< CellRenderer* > | get_focus_siblings (CellRenderer& renderer)
| Gets the focus sibling cell renderers for renderer. More...
std::vector< const CellRenderer* > | get_focus_siblings (const CellRenderer& renderer) const
| Gets the focus sibling cell renderers for renderer. More...
CellRenderer* | get_focus_from_sibling (CellRenderer& renderer)
| Gets the Gtk::CellRenderer which is expected to be focusable for which renderer is, or may be a sibling. More...
const CellRenderer* | get_focus_from_sibling (CellRenderer& renderer) const
| Gets the Gtk::CellRenderer which is expected to be focusable for which renderer is, or may be a sibling. More...
CellRenderer* | get_edited_cell ()
| Gets the Gtk::CellRenderer in area that is currently being edited. More...
const CellRenderer* | get_edited_cell () const
| Gets the Gtk::CellRenderer in area that is currently being edited. More...
CellEditable* | get_edit_widget ()
| Gets the Gtk::CellEditable widget currently used to edit the currently edited cell. More...
const CellEditable* | get_edit_widget () const
| Gets the Gtk::CellEditable widget currently used to edit the currently edited cell. More...
bool | activate_cell (Widget& widget, CellRenderer& renderer, GdkEvent*event, const Gdk::Rectangle& cell_area, CellRendererState flags)
| This is used by Gtk::CellArea subclasses when handling events to activate cells, the base Gtk::CellArea class activates cells for keyboard events for free in its own GtkCellArea->activate() implementation. More...
void | stop_editing (bool canceled)
| Explicitly stops the editing of the currently edited cell. More...
void | inner_cell_area (Widget& widget, const Gdk::Rectangle& cell_area, Gdk::Rectangle& inner_area)
| This is a convenience function for Gtk::CellArea implementations to get the inner area where a given Gtk::CellRenderer will be rendered. More...
void | request_renderer (CellRenderer& renderer, Orientation orientation, Widget& widget, int for_size, int& minimum_size, int& natural_size)
| This is a convenience function for Gtk::CellArea implementations to request size for cell renderers. More...
Public Member Functions inherited from Gtk::Buildable
virtual | ~Buildable ()
GtkBuildable* | gobj ()
| Provides access to the underlying C GObject. More...
const GtkBuildable* | gobj () const
| Provides access to the underlying C GObject. More...
void | set_name (const Glib::ustring& name)
| Sets the name of the buildable object. More...
Glib::ustring | get_name () const
| Gets the name of the buildable object. More...
Public Member Functions inherited from Gtk::CellLayout
virtual | ~CellLayout ()
GtkCellLayout* | gobj ()
| Provides access to the underlying C GObject. More...
const GtkCellLayout* | gobj () const
| Provides access to the underlying C GObject. More...
template<class ColumnType >
void | pack_start (const TreeModelColumn< ColumnType >& model_column, bool expand=true)
void | pack_start (CellRenderer& cell, bool expand=true)
| Packs the cell into the beginning of cell_layout. More...
void | pack_end (CellRenderer& cell, bool expand=true)
| Adds the cell to the end of cell_layout. More...
std::vector< CellRenderer* > | get_cells ()
| Return value: a list of cell renderers. More...
std::vector< const CellRenderer* > | get_cells () const
| Return value: a list of cell renderers. More...
CellRenderer* | get_first_cell ()
| Gets the CellRenderer for the column. More...
const CellRenderer* | get_first_cell () const
| Gets the CellRenderer for the column. More...
void | clear ()
| Unsets all the mappings on all renderers on cell_layout and removes all renderers from cell_layout. More...
void | add_attribute (CellRenderer& cell, const Glib::ustring& attribute, int column)
| Adds an attribute mapping to the list in cell_layout. More...
void | add_attribute (const Glib::PropertyProxy_Base& property, const TreeModelColumnBase& column)
void | add_attribute (CellRenderer& cell, const Glib::ustring& attribute, const TreeModelColumnBase& column)
void | set_cell_data_func (CellRenderer& cell, const SlotCellData& slot)
void | clear_attributes (CellRenderer& cell)
| Clears all existing attributes previously set with set_attributes(). More...
void | reorder (CellRenderer& cell, int position)
| Re-inserts cell at position. More...
Glib::RefPtr< CellArea > | get_area ()
| Returns the underlying Gtk::CellArea which might be cell_layout if called on a Gtk::CellArea or might be `0` if no Gtk::CellArea is used by cell_layout. More...
Glib::RefPtr< const CellArea > | get_area () const
| Returns the underlying Gtk::CellArea which might be cell_layout if called on a Gtk::CellArea or might be `0` if no Gtk::CellArea is used by cell_layout. More...
template<class T_ModelColumnType >
void | pack_start (const TreeModelColumn< T_ModelColumnType >& column, bool expand)

## Static Public Member Functions

static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
Static Public Member Functions inherited from Gtk::Buildable
static void | add_interface (GType gtype_implementer)
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
Static Public Member Functions inherited from Gtk::CellLayout
static void | add_interface (GType gtype_implementer)
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...

## Protected Member Functions

| CellArea ()
Glib::SignalProxy4< void, CellRenderer*, CellEditable *, const Gdk::Rectangle &, const Glib::ustring& > | signal_add_editable ()
Glib::SignalProxy2< void, CellRenderer*, CellEditable* > | signal_remove_editable ()
Glib::SignalProxy2< void, CellRenderer*, const Glib::ustring& > | signal_focus_changed ()
virtual SizeRequestMode | get_request_mode_vfunc () const
virtual void | get_preferred_width_vfunc (const Glib::RefPtr< CellAreaContext >& context, Widget& widget, int& minimum_width, int& natural_width)
virtual void | get_preferred_height_for_width_vfunc (const Glib::RefPtr< CellAreaContext >& context, Widget& widget, int width, int& minimum_height, int& natural_height)
virtual void | get_preferred_height_vfunc (const Glib::RefPtr< CellAreaContext >& context, Widget& widget, int& minimum_height, int& natural_height)
virtual void | get_preferred_width_for_height_vfunc (const Glib::RefPtr< CellAreaContext >& context, Widget& widget, int height, int& minimum_width, int& natural_width)
Glib::PropertyProxy < CellRenderer* > | property_focus_cell ()
| The cell which currently has focus. More...
Glib::PropertyProxy_ReadOnly < CellRenderer* > | property_focus_cell () const
| The cell which currently has focus. More...
Glib::PropertyProxy_ReadOnly < CellRenderer* > | property_edited_cell () const
| The cell which is currently being edited. More...
Glib::PropertyProxy_ReadOnly < CellEditable* > | property_edit_widget () const
| The widget currently editing the edited cell. More...
Protected Member Functions inherited from Gtk::Buildable
| Buildable ()
| You should derive from this class to use it. More...
Protected Member Functions inherited from Gtk::CellLayout
| CellLayout ()
| You should derive from this class to use it. More...
virtual void | pack_start_vfunc (CellRenderer* cell, bool expand)
virtual void | pack_end_vfunc (CellRenderer* cell, bool expand)
virtual void | clear_vfunc ()
virtual void | add_attribute_vfunc (CellRenderer* cell, const Glib::ustring& attribute, int column)
virtual void | clear_attributes_vfunc (CellRenderer* cell)
virtual void | reorder_vfunc (CellRenderer* cell, int position)

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr< Gtk::CellArea > | wrap (GtkCellArea* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...
Related Functions inherited from Gtk::Buildable
Glib::RefPtr< Gtk::Buildable > | wrap (GtkBuildable* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...
Related Functions inherited from Gtk::CellLayout
Glib::RefPtr< Gtk::CellLayout > | wrap (GtkCellLayout* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Detailed Description

An abstract base class for laying out CellRenderers.

This is an abstract base class for CellLayout widgets (also referred to as "layouting widgets") to interface with an arbitrary number of CellRenderers and interact with the user for a given TreeModel row.

The cell area handles events, focus navigation, drawing and size requests and allocations for a given row of data.

Usually users dont have to interact with the CellArea directly unless they are implementing a cell layouting widget themselves.

Requesting area sizes

As outlined in Gtk::Widget's geometry management description, GTK+ uses a height-for-width geometry management system to compute the sizes of widgets and user interfaces. CellArea uses the same semantics to calculate the size of an area for an arbitrary number of TreeModel rows.

When requesting the size of a cell area one needs to calculate the size for a handful of rows, and this will be done differently by different layouting widgets. For instance a TreeViewColumn always lines up the areas from top to bottom while an IconView, on the other hand, might enforce that all areas received the same width and wrap the areas around, requesting height for more cell areas when allocated less width.

It's also important for areas to maintain some cell alignments with areas rendered for adjacent rows (cells can appear "columnized" inside an area even when the size of cells are different in each row). For this reason the CellArea uses a CellAreaContext object to store the alignments and sizes along the way (as well as the overall largest minimum and natural size for all the rows which have been calculated with the said context).

The CellAreaContext is an opaque object specific to the CellArea which created it (see CellArea::create_context()). The owning cell-layouting widget can create as many contexts as it wishes to calculate sizes of rows which should receive the same size in at least one orientation (horizontally or vertically). However, it's important that the same CellAreaContext which was used to request the sizes for a given TreeModel row be used when rendering or processing events for that row.

Cell Properties

The CellArea introduces cell propertie for CellRenderers in very much the same way that Gtk::Container introduces child properties for Widgets. This provides some general interfaces for defining the relationship cell areas have with their cells. For instance in a CellAreaBox a cell might "expand" and receive extra space when the area is allocated more than its full natural request, or a cell might be configured to "align" with adjacent rows which were requested and rendered with the same CellAreaContext.

To set the value of a cell property, use cell_set_property(). To obtain the value of a cell property, use cell_get_property().

Since gtkmm 3.0:

## Member Typedef Documentation

typedef sigc::slot<bool, CellRenderer*> Gtk::CellArea::SlotForeach

For instance, bool on_foreach(Gtk::CellRenderer* renderer);.

Parameters

  renderer | the cell renderer to operate on

Returns
  true to stop iterating over cells.

Since gtkmm 3.4:

typedef sigc::slot<bool, CellRenderer*, const Gdk::Rectangle&, const Gdk::Rectangle&> Gtk::CellArea::SlotForeachAlloc

For instance, bool on_foreach(Gtk::CellRenderer* renderer, const Gdk::Rectangle& cell_area, const Gdk::Rectangle& background_area>);.

Parameters

  renderer | the cell renderer to operate on
  cell_area | the area allocated to the renderer inside the rectangle provided to foreach(). @param cell_background The background area for the renderer inside the background area provided to foreach().
  slot | The slot to call for every CellRenderer.

Returns
  true to stop iterating over cells.

Since gtkmm 3.4:

## Constructor & Destructor Documentation

virtual Gtk::CellArea::~CellArea | ( |  | ) |

virtual

Gtk::CellArea::CellArea | ( |  | ) |

protected

## Member Function Documentation

bool Gtk::CellArea::activate | ( | const Glib::RefPtr< CellAreaContext >& | context,
|  | Widget& | widget,
|  | const Gdk::Rectangle& | cell_area,
|  | CellRendererState | flags,
|  | bool | edit_only
| ) |  |

Activates area, usually by activating the currently focused cell, however some subclasses which embed widgets in the area can also activate a widget if it currently has the focus.

Since gtkmm 3.0:

Parameters

  context | The Gtk::CellAreaContext in context with the current row data.
  widget | The Gtk::Widget that area is rendering on.
  cell_area | The size and location of area relative to widget's allocation.
  flags | The Gtk::CellRendererState flags for area for this row of data.
  edit_only | If `true` then only cell renderers that are Gtk::CELL_RENDERER_MODE_EDITABLE will be activated.

Returns
  Whether area was successfully activated.

bool Gtk::CellArea::activate_cell | ( | Widget& | widget,
|  | CellRenderer& | renderer,
|  | GdkEvent * | event,
|  | const Gdk::Rectangle& | cell_area,
|  | CellRendererState | flags
| ) |  |

This is used by Gtk::CellArea subclasses when handling events to activate cells, the base Gtk::CellArea class activates cells for keyboard events for free in its own GtkCellArea->activate() implementation.

Since gtkmm 3.0:

Parameters

  widget | The Gtk::Widget that area is rendering onto.
  renderer | The Gtk::CellRenderer in area to activate.
  event | The Gdk::Event for which cell activation should occur.
  cell_area | The Gdk::Rectangle in widget relative coordinates of renderer for the current row.
  flags | The Gtk::CellRendererState for renderer.

Returns
  Whether cell activation was successful.

void Gtk::CellArea::add | ( | CellRenderer& | renderer | ) |

Adds renderer to area with the default child cell properties.

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer to add to area.

void Gtk::CellArea::add_focus_sibling | ( | CellRenderer& | renderer,
|  | CellRenderer& | sibling
| ) |  |

Adds sibling to renderer's focusable area, focus will be drawn around renderer and all of its siblings if renderer can focus for a given row.

Events handled by focus siblings can also activate the given focusable renderer.

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer expected to have focus.
  sibling | The Gtk::CellRenderer to add to renderer's focus area.

void Gtk::CellArea::apply_attributes | ( | const Glib::RefPtr< TreeModel >& | tree_model,
|  | const TreeModel::iterator& | iter,
|  | bool | is_expander,
|  | bool | is_expanded
| ) |  |

Applies any connected attributes to the renderers in area by pulling the values from tree_model.

Since gtkmm 3.0:

Parameters

  tree_model | The Gtk::TreeModel to pull values from.
  iter | The Gtk::TreeIter in tree_model to apply values for.
  is_expander | Whether iter has children.
  is_expanded | Whether iter is expanded in the view and children are visible.

void Gtk::CellArea::attribute_connect | ( | CellRenderer& | renderer,
|  | const Glib::ustring & | attribute,
|  | int | column
| ) |  |

Connects an attribute to apply values from column for the Gtk::TreeModel in use.

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer to connect an attribute for.
  attribute | The attribute name.
  column | The Gtk::TreeModel column to fetch attribute values from.

void Gtk::CellArea::attribute_disconnect | ( | CellRenderer& | renderer,
|  | const Glib::ustring & | attribute
| ) |  |

Disconnects attribute for the renderer in area so that attribute will no longer be updated with values from the model.

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer to disconnect an attribute for.
  attribute | The attribute name.

void Gtk::CellArea::cell_get_property | ( | CellRenderer& | renderer,
|  | const Glib::ustring & | property_name,
|  | Glib::ValueBase & | value
| ) |  |

Gets the value of a cell property for renderer in area.

Since gtkmm 3.0:

Parameters

  renderer | A Gtk::CellRenderer inside area.
  property_name | The name of the property to get.
  value | A location to return the value.

void Gtk::CellArea::cell_set_property | ( | CellRenderer& | renderer,
|  | const Glib::ustring & | property_name,
|  | const Glib::ValueBase & | value
| ) |  |

Sets a cell property for renderer in area.

Since gtkmm 3.0:

Parameters

  renderer | A Gtk::CellRenderer inside area.
  property_name | The name of the cell property to set.
  value | The value to set the cell property to.

Glib::RefPtr<CellAreaContext> Gtk::CellArea::copy_context | ( | const Glib::RefPtr< const CellAreaContext >& | context | ) |

This is sometimes needed for cases where rows need to share alignments in one orientation but may be separately grouped in the opposing orientation.

For instance, Gtk::IconView creates all icons (rows) to have the same width and the cells theirin to have the same horizontal alignments. However each row of icons may have a separate collective height. Gtk::IconView uses this to request the heights of each row based on a context which was already used to request all the row widths that are to be displayed.

Since gtkmm 3.0:

Parameters

  context | The Gtk::CellAreaContext to copy.

Returns
  A newly created Gtk::CellAreaContext copy of context.

Glib::RefPtr<CellAreaContext> Gtk::CellArea::create_context | ( |  | ) | const

Creates a Gtk::CellAreaContext to be used with area for all purposes.

Gtk::CellAreaContext stores geometry information for rows for which it was operated on, it is important to use the same context for the same row of data at all times (i.e. one should render and handle events with the same Gtk::CellAreaContext which was used to request the size of those rows of data).

Since gtkmm 3.0:

Returns
  A newly created Gtk::CellAreaContext which can be used with area.

int Gtk::CellArea::event | ( | const Glib::RefPtr< CellAreaContext >& | context,
|  | Widget& | widget,
|  | GdkEvent * | event,
|  | const Gdk::Rectangle& | cell_area,
|  | GtkCellRendererState | flags
| ) |  |

Delegates event handling to a Gtk::CellArea.

Since gtkmm 3.0:

Parameters

  context | The Gtk::CellAreaContext for this row of data.
  widget | The Gtk::Widget that area is rendering to.
  event | The Gdk::Event to handle.
  cell_area | The widget relative coordinates for area.
  flags | The Gtk::CellRendererState for area in this row.

Returns
  `true` if the event was handled by area.

bool Gtk::CellArea::focus | ( | DirectionType | direction | ) |

This should be called by the area's owning layout widget when focus is to be passed to area, or moved within area for a given direction and row data.

Implementing Gtk::CellArea classes should implement this method to receive and navigate focus in its own way particular to how it lays out cells.

Since gtkmm 3.0:

Parameters

  direction | The Gtk::DirectionType.

Returns
  `true` if focus remains inside area as a result of this call.

void Gtk::CellArea::foreach | ( | const SlotForeach& | slot | ) |

Calls the slot for every CellRenderer in the CellArea.

Parameters

  slot | The slot to call for every CellRenderer.

Since gtkmm 3.4:

void Gtk::CellArea::foreach | ( | const Glib::RefPtr< CellAreaContext >& | context,
|  | Widget* | widget,
|  | const Gdk::Rectangle& | cell_area,
|  | const Gdk::Rectangle& | background_area,
|  | const SlotForeachAlloc& | slot
| ) |  |

Calls the slot for every CellRenderer in the CellArea with the allocated rectangle inside the cell_area rectangle.

Parameters

  context | The CellAreaContext for this row of data.
  widget | The widget that the CellArea is rendering to.
  cell_area | The widget-relative coordinates and size for the CellArea.
  background_area | The widget-relative coordinates of the background area.
  slot | The slot to call for every CellRenderer.

Since gtkmm 3.4:

void Gtk::CellArea::get_cell_allocation | ( | const Glib::RefPtr< CellAreaContext >& | context,
|  | Widget& | widget,
|  | CellRenderer& | renderer,
|  | const Gdk::Rectangle& | cell_area,
|  | Gdk::Rectangle& | allocation
| ) |  |

Derives the allocation of renderer inside area if area were to be renderered in cell_area.

Since gtkmm 3.0:

Parameters

  context | The Gtk::CellAreaContext used to hold sizes for area.
  widget | The Gtk::Widget that area is rendering on.
  renderer | The Gtk::CellRenderer to get the allocation for.
  cell_area | The whole allocated area for area in widget for this row.
  allocation | Where to store the allocation for renderer.

CellRenderer* Gtk::CellArea::get_cell_at_position | ( | const Glib::RefPtr< CellAreaContext >& | context,
|  | Widget& | widget,
|  | const Gdk::Rectangle& | cell_area,
|  | int | x,
|  | int | y,
|  | Gdk::Rectangle& | alloc_area
| ) |  |

Gets the Gtk::CellRenderer at x and y coordinates inside area and optionally returns the full cell allocation for it inside cell_area.

Since gtkmm 3.0:

Parameters

  context | The Gtk::CellAreaContext used to hold sizes for area.
  widget | The Gtk::Widget that area is rendering on.
  cell_area | The whole allocated area for area in widget for this row.
  x | The x position.
  y | The y position.
  alloc_area | Where to store the inner allocated area of the returned cell renderer, or `0`.

Returns
  The Gtk::CellRenderer at x and y.

const CellRenderer* Gtk::CellArea::get_cell_at_position | ( | const Glib::RefPtr< CellAreaContext >& | context,
|  | Widget& | widget,
|  | const Gdk::Rectangle& | cell_area,
|  | int | x,
|  | int | y,
|  | Gdk::Rectangle& | alloc_area
| ) |  | const

Gets the Gtk::CellRenderer at x and y coordinates inside area and optionally returns the full cell allocation for it inside cell_area.

Since gtkmm 3.0:

Parameters

  context | The Gtk::CellAreaContext used to hold sizes for area.
  widget | The Gtk::Widget that area is rendering on.
  cell_area | The whole allocated area for area in widget for this row.
  x | The x position.
  y | The y position.
  alloc_area | Where to store the inner allocated area of the returned cell renderer, or `0`.

Returns
  The Gtk::CellRenderer at x and y.

Glib::ustring Gtk::CellArea::get_current_path_string | ( |  | ) | const

Gets the current Gtk::TreePath string for the currently applied Gtk::TreeIter, this is implicitly updated when apply_attributes() is called and can be used to interact with renderers from Gtk::CellArea subclasses.

Since gtkmm 3.0:

Returns
  The current Gtk::TreePath string for the current attributes applied to area. This string belongs to the area and should not be freed.

CellEditable* Gtk::CellArea::get_edit_widget | ( |  | ) |

Gets the Gtk::CellEditable widget currently used to edit the currently edited cell.

Since gtkmm 3.0:

Returns
  The currently active Gtk::CellEditable widget.

const CellEditable* Gtk::CellArea::get_edit_widget | ( |  | ) | const

Gets the Gtk::CellEditable widget currently used to edit the currently edited cell.

Since gtkmm 3.0:

Returns
  The currently active Gtk::CellEditable widget.

CellRenderer* Gtk::CellArea::get_edited_cell | ( |  | ) |

Gets the Gtk::CellRenderer in area that is currently being edited.

Since gtkmm 3.0:

Returns
  The currently edited Gtk::CellRenderer.

const CellRenderer* Gtk::CellArea::get_edited_cell | ( |  | ) | const

Gets the Gtk::CellRenderer in area that is currently being edited.

Since gtkmm 3.0:

Returns
  The currently edited Gtk::CellRenderer.

CellRenderer* Gtk::CellArea::get_focus_cell | ( |  | ) |

Retrieves the currently focused cell for area.

Since gtkmm 3.0:

Returns
  The currently focused cell in area.

const CellRenderer* Gtk::CellArea::get_focus_cell | ( |  | ) | const

Retrieves the currently focused cell for area.

Since gtkmm 3.0:

Returns
  The currently focused cell in area.

CellRenderer* Gtk::CellArea::get_focus_from_sibling | ( | CellRenderer& | renderer | ) |

Gets the Gtk::CellRenderer which is expected to be focusable for which renderer is, or may be a sibling.

This is handy for Gtk::CellArea subclasses when handling events, after determining the renderer at the event location it can then chose to activate the focus cell for which the event cell may have been a sibling.

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer.

Returns
  The Gtk::CellRenderer for which renderer is a sibling, or `0`.

const CellRenderer* Gtk::CellArea::get_focus_from_sibling | ( | CellRenderer& | renderer | ) | const

Gets the Gtk::CellRenderer which is expected to be focusable for which renderer is, or may be a sibling.

This is handy for Gtk::CellArea subclasses when handling events, after determining the renderer at the event location it can then chose to activate the focus cell for which the event cell may have been a sibling.

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer.

Returns
  The Gtk::CellRenderer for which renderer is a sibling, or `0`.

std::vector<CellRenderer*> Gtk::CellArea::get_focus_siblings | ( | CellRenderer& | renderer | ) |

Gets the focus sibling cell renderers for renderer.

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer expected to have focus.

Returns
  A List of Gtk::CellRenderers. The returned list is internal and should not be freed.

std::vector<const CellRenderer*> Gtk::CellArea::get_focus_siblings | ( | const CellRenderer& | renderer | ) | const

Gets the focus sibling cell renderers for renderer.

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer expected to have focus.

Returns
  A List of Gtk::CellRenderers. The returned list is internal and should not be freed.

void Gtk::CellArea::get_preferred_height | ( | const Glib::RefPtr< CellAreaContext >& | context,
|  | Widget& | widget,
|  | int & | minimum_height,
|  | int & | natural_height
| ) |  |

Retrieves a cell area's initial minimum and natural height.

area will store some geometrical information in context along the way; when requesting sizes over an arbitrary number of rows, it's not important to check the minimum_height and natural_height of this call but rather to consult Gtk::CellAreaContext::get_preferred_height() after a series of requests.

Since gtkmm 3.0:

Parameters

  context | The Gtk::CellAreaContext to perform this request with.
  widget | The Gtk::Widget where area will be rendering.
  minimum_height | Location to store the minimum height, or `0`.
  natural_height | Location to store the natural height, or `0`.

void Gtk::CellArea::get_preferred_height_for_width | ( | const Glib::RefPtr< CellAreaContext >& | context,
|  | Widget& | widget,
|  | int | width,
|  | int & | minimum_height,
|  | int & | natural_height
| ) |  |

Retrieves a cell area's minimum and natural height if it would be given the specified width.

area stores some geometrical information in context along the way while calling get_preferred_width(). It's important to perform a series of get_preferred_width() requests with context first and then call get_preferred_height_for_width() on each cell area individually to get the height for width of each fully requested row.

If at some point, the width of a single row changes, it should be requested with get_preferred_width() again and then the full width of the requested rows checked again with Gtk::CellAreaContext::get_preferred_width().

Since gtkmm 3.0:

Parameters

  context | The Gtk::CellAreaContext which has already been requested for widths.
  widget | The Gtk::Widget where area will be rendering.
  width | The width for which to check the height of this area.
  minimum_height | Location to store the minimum height, or `0`.
  natural_height | Location to store the natural height, or `0`.

virtual void Gtk::CellArea::get_preferred_height_for_width_vfunc | ( | const Glib::RefPtr< CellAreaContext >& | context,
|  | Widget& | widget,
|  | int | width,
|  | int & | minimum_height,
|  | int & | natural_height
| ) |  |

protected virtual

virtual void Gtk::CellArea::get_preferred_height_vfunc | ( | const Glib::RefPtr< CellAreaContext >& | context,
|  | Widget& | widget,
|  | int & | minimum_height,
|  | int & | natural_height
| ) |  |

protected virtual

void Gtk::CellArea::get_preferred_width | ( | const Glib::RefPtr< CellAreaContext >& | context,
|  | Widget& | widget,
|  | int & | minimum_width,
|  | int & | natural_width
| ) |  |

Retrieves a cell area's initial minimum and natural width.

area will store some geometrical information in context along the way; when requesting sizes over an arbitrary number of rows, it's not important to check the minimum_width and natural_width of this call but rather to consult Gtk::CellAreaContext::get_preferred_width() after a series of requests.

Since gtkmm 3.0:

Parameters

  context | The Gtk::CellAreaContext to perform this request with.
  widget | The Gtk::Widget where area will be rendering.
  minimum_width | Location to store the minimum width, or `0`.
  natural_width | Location to store the natural width, or `0`.

void Gtk::CellArea::get_preferred_width_for_height | ( | const Glib::RefPtr< CellAreaContext >& | context,
|  | Widget& | widget,
|  | int | height,
|  | int & | minimum_width,
|  | int & | natural_width
| ) |  |

Retrieves a cell area's minimum and natural width if it would be given the specified height.

area stores some geometrical information in context along the way while calling get_preferred_height(). It's important to perform a series of get_preferred_height() requests with context first and then call get_preferred_width_for_height() on each cell area individually to get the height for width of each fully requested row.

If at some point, the height of a single row changes, it should be requested with get_preferred_height() again and then the full height of the requested rows checked again with Gtk::CellAreaContext::get_preferred_height().

Since gtkmm 3.0:

Parameters

  context | The Gtk::CellAreaContext which has already been requested for widths.
  widget | The Gtk::Widget where area will be rendering.
  height | The height for which to check the width of this area.
  minimum_width | Location to store the minimum width, or `0`.
  natural_width | Location to store the natural width, or `0`.

virtual void Gtk::CellArea::get_preferred_width_for_height_vfunc | ( | const Glib::RefPtr< CellAreaContext >& | context,
|  | Widget& | widget,
|  | int | height,
|  | int & | minimum_width,
|  | int & | natural_width
| ) |  |

protected virtual

virtual void Gtk::CellArea::get_preferred_width_vfunc | ( | const Glib::RefPtr< CellAreaContext >& | context,
|  | Widget& | widget,
|  | int & | minimum_width,
|  | int & | natural_width
| ) |  |

protected virtual

SizeRequestMode Gtk::CellArea::get_request_mode | ( |  | ) | const

Gets whether the area prefers a height-for-width layout or a width-for-height layout.

Since gtkmm 3.0:

Returns
  The Gtk::SizeRequestMode preferred by area.

virtual SizeRequestMode Gtk::CellArea::get_request_mode_vfunc | ( |  | ) | const

protected virtual

static GType Gtk::CellArea::get_type | ( |  | ) |

static

Get the GType for this class, for use with the underlying GObject type system.

GtkCellArea* Gtk::CellArea::gobj | ( |  | ) |

inline

Provides access to the underlying C GObject.

const GtkCellArea* Gtk::CellArea::gobj | ( |  | ) | const

inline

Provides access to the underlying C GObject.

GtkCellArea* Gtk::CellArea::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

bool Gtk::CellArea::has_renderer | ( | CellRenderer& | renderer | ) |

Checks if area contains renderer.

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer to check.

Returns
  `true` if renderer is in the area.

void Gtk::CellArea::inner_cell_area | ( | Widget& | widget,
|  | const Gdk::Rectangle& | cell_area,
|  | Gdk::Rectangle& | inner_area
| ) |  |

This is a convenience function for Gtk::CellArea implementations to get the inner area where a given Gtk::CellRenderer will be rendered.

It removes any padding previously added by request_renderer().

Since gtkmm 3.0:

Parameters

  widget | The Gtk::Widget that area is rendering onto.
  cell_area | The widget relative coordinates where one of area's cells is to be placed.
  inner_area | The return location for the inner cell area.

bool Gtk::CellArea::is_activatable | ( |  | ) | const

Returns whether the area can do anything when activated, after applying new attributes to area.

Since gtkmm 3.0:

Returns
  Whether area can do anything when activated.

bool Gtk::CellArea::is_focus_sibling | ( | CellRenderer& | renderer,
|  | CellRenderer& | sibling
| ) |  |

Returns whether sibling is one of renderer's focus siblings (see add_focus_sibling()).

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer expected to have focus.
  sibling | The Gtk::CellRenderer to check against renderer's sibling list.

Returns
  `true` if sibling is a focus sibling of renderer.

Glib::PropertyProxy_ReadOnly< CellEditable* > Gtk::CellArea::property_edit_widget | ( |  | ) | const

protected

The widget currently editing the edited cell.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly< CellRenderer* > Gtk::CellArea::property_edited_cell | ( |  | ) | const

protected

The cell which is currently being edited.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

Glib::PropertyProxy< CellRenderer* > Gtk::CellArea::property_focus_cell | ( |  | ) |

protected

The cell which currently has focus.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly< CellRenderer* > Gtk::CellArea::property_focus_cell | ( |  | ) | const

protected

The cell which currently has focus.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

void Gtk::CellArea::remove | ( | CellRenderer& | renderer | ) |

Removes renderer from area.

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer to remove from area.

void Gtk::CellArea::remove_focus_sibling | ( | CellRenderer& | renderer,
|  | CellRenderer& | sibling
| ) |  |

Removes sibling from renderer's focus sibling list (see add_focus_sibling()).

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer expected to have focus.
  sibling | The Gtk::CellRenderer to remove from renderer's focus area.

void Gtk::CellArea::render | ( | const Glib::RefPtr< CellAreaContext >& | context,
|  | Widget& | widget,
|  | const ::Cairo::RefPtr< ::Cairo::Context > & | cr,
|  | const Gdk::Rectangle& | background_area,
|  | const Gdk::Rectangle& | cell_area,
|  | CellRendererState | flags,
|  | bool | paint_focus
| ) |  |

Renders area's cells according to area's layout onto widget at the given coordinates.

Since gtkmm 3.0:

Parameters

  context | The Gtk::CellAreaContext for this row of data.
  widget | The Gtk::Widget that area is rendering to.
  cr | The #cairo_t to render with.
  background_area | The widget relative coordinates for area's background.
  cell_area | The widget relative coordinates for area.
  flags | The Gtk::CellRendererState for area in this row.
  paint_focus | Whether area should paint focus on focused cells for focused rows or not.

void Gtk::CellArea::request_renderer | ( | CellRenderer& | renderer,
|  | Orientation | orientation,
|  | Widget& | widget,
|  | int | for_size,
|  | int & | minimum_size,
|  | int & | natural_size
| ) |  |

This is a convenience function for Gtk::CellArea implementations to request size for cell renderers.

It's important to use this function to request size and then use inner_cell_area() at render and event time since this function will add padding around the cell for focus painting.

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer to request size for.
  orientation | The Gtk::Orientation in which to request size.
  widget | The Gtk::Widget that area is rendering onto.
  for_size | The allocation contextual size to request for, or -1 if the base request for the orientation is to be returned.
  minimum_size | Location to store the minimum size, or `0`.
  natural_size | Location to store the natural size, or `0`.

void Gtk::CellArea::set_focus_cell | ( | CellRenderer& | renderer | ) |

Explicitly sets the currently focused cell to renderer.

This is generally called by implementations of Gtk::CellAreaClass.focus() or Gtk::CellAreaClass.event(), however it can also be used to implement functions such as Gtk::TreeView::set_cursor_on_cell().

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer to give focus to.

Glib::SignalProxy4< void,CellRenderer*,CellEditable*,const Gdk::Rectangle&,const Glib::ustring& > Gtk::CellArea::signal_add_editable | ( |  | ) |

protected

Slot Prototype:
  `void on_my_add_editable(CellRenderer* renderer, CellEditable* editable, const Gdk::Rectangle& cell_area, const Glib::ustring& path)`

Indicates that editing has started on renderer and that editable should be added to the owning cell-layouting widget at cell_area.

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer that started the edited.
  editable | The Gtk::CellEditable widget to add.
  cell_area | The Gtk::Widget relative Gdk::Rectangle coordinates where editable should be added.
  path | The Gtk::TreePath string this edit was initiated for.

Glib::SignalProxy2< void,CellRenderer*,const Glib::ustring& > Gtk::CellArea::signal_focus_changed | ( |  | ) |

protected

Slot Prototype:
  `void on_my_focus_changed(CellRenderer* renderer, const Glib::ustring& path)`

Indicates that focus changed on this area. This signal is emitted either as a result of focus handling or event handling.

It's possible that the signal is emitted even if the currently focused renderer did not change, this is because focus may change to the same renderer in the same cell area for a different row of data.

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer that has focus.
  path | The current Gtk::TreePath string set for area.

Glib::SignalProxy2< void,CellRenderer*,CellEditable* > Gtk::CellArea::signal_remove_editable | ( |  | ) |

protected

Slot Prototype:
  `void on_my_remove_editable(CellRenderer* renderer, CellEditable* editable)`

Indicates that editing finished on renderer and that editable should be removed from the owning cell-layouting widget.

Since gtkmm 3.0:

Parameters

  renderer | The Gtk::CellRenderer that finished editeding.
  editable | The Gtk::CellEditable widget to remove.

void Gtk::CellArea::stop_editing | ( | bool | canceled | ) |

Explicitly stops the editing of the currently edited cell.

If canceled is `true`, the currently edited cell renderer will emit the signal_editing_canceled() signal, otherwise the the signal_editing_done() signal will be emitted on the current edit widget.

See get_edited_cell() and get_edit_widget().

Since gtkmm 3.0:

Parameters

  canceled | Whether editing was canceled.

## Friends And Related Function Documentation

Glib::RefPtr< Gtk::CellArea > wrap | ( | GtkCellArea * | object,
|  | bool | take_copy = `false`
| ) |  |

related

A Glib::wrap() method for this object.

Parameters

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gtkmm/cellarea.h