gtkmm 3.2.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Related Functions

# Gtk::CellArea Class Reference

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

Inheritance diagram for Gtk::CellArea:
[legend]

List of all members.

## Public Member Functions
virtual | ~CellArea ()
GtkCellArea* | gobj ()
| Provides access to the underlying C GObject.
const GtkCellArea* | gobj () const
| Provides access to the underlying C GObject.
GtkCellArea* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
void | add (CellRenderer& renderer)
| Adds renderer to area with the default child cell properties.
void | remove (CellRenderer& renderer)
| Removes renderer from area.
bool | has_renderer (CellRenderer& renderer)
| Checks if area contains renderer.
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.
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.
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.
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.
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.
Glib::RefPtr< CellAreaContext > | create_context () const
| Creates a Gtk::CellAreaContext to be used with area for all purposes.
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.
SizeRequestMode | get_request_mode () const
| Gets whether the area prefers a height-for-width layout or a width-for-height layout.
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.
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.
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.
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.
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.
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.
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.
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.
void | cell_set_property (CellRenderer& renderer, const Glib::ustring& property_name, const Glib::ValueBase&value)
| Sets a cell property for renderer in area.
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.
bool | is_activatable () const
| Returns whether the area can do anything when activated, after applying new attributes to area.
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.
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.
void | set_focus_cell (CellRenderer& renderer)
| Explicitly sets the currently focused cell to renderer.
CellRenderer* | get_focus_cell ()
| Retrieves the currently focused cell for area.
const CellRenderer* | get_focus_cell () const
| Retrieves the currently focused cell for area.
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.
void | remove_focus_sibling (CellRenderer& renderer, CellRenderer& sibling)
| Removes sibling from renderer's focus sibling list (see add_focus_sibling()).
bool | is_focus_sibling (CellRenderer& renderer, CellRenderer& sibling)
| Returns whether sibling is one of renderer's focus siblings (see add_focus_sibling()).
std::vector< CellRenderer* > | get_focus_siblings (CellRenderer& renderer)
| Gets the focus sibling cell renderers for renderer.
std::vector< const CellRenderer* > | get_focus_siblings (const CellRenderer& renderer) const
| Gets the focus sibling cell renderers for renderer.
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.
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.
CellRenderer* | get_edited_cell ()
| Gets the Gtk::CellRenderer in area that is currently being edited.
const CellRenderer* | get_edited_cell () const
| Gets the Gtk::CellRenderer in area that is currently being edited.
CellEditable* | get_edit_widget ()
| Gets the Gtk::CellEditable widget currently used to edit the currently edited cell.
const CellEditable* | get_edit_widget () const
| Gets the Gtk::CellEditable widget currently used to edit the currently edited cell.
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.
void | stop_editing (bool canceled)
| Explicitly stops the editing of the currently edited cell (see get_edited_cell()).
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.
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.
## Protected Member Functions
| CellArea ()
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)
## 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.

## 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:

## 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::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.

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`.

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`.

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, its 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, its 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]`

const GtkCellArea* Gtk::CellArea::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gtk::Buildable.

Reimplemented in Gtk::CellAreaBox.

GtkCellArea* Gtk::CellArea::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gtk::Buildable.

Reimplemented in Gtk::CellAreaBox.

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.

Reimplemented in Gtk::CellAreaBox.

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.

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.

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

Explicitly stops the editing of the currently edited cell (see get_edited_cell()).

If canceled is `true`, the cell renderer will emit the ::editing-canceled signal.

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