Class: Gtk::CellAreaContext

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#allocate(width, height) ⇒ nil

Allocates a width and/or a height for all rows which are to be rendered with context.

Usually allocation is performed only horizontally or sometimes vertically since a group of rows are usually rendered side by side vertically or horizontally and share either the same width or the same height. Sometimes they are allocated in both horizontal and vertical orientations producing a homogeneous effect of the rows. This is generally the case for Gtk::TreeView when Gtk::TreeView:fixed-height-mode is enabled.

Since 3.0

Parameters:

  • width (Integer)

    the allocated width for all Gtk::TreeModel rows rendered with context, or -1.

  • height (Integer)

    the allocated height for all Gtk::TreeModel rows rendered with context, or -1.

Returns:

  • (nil)

#areaGtk::CellArea

The Gtk::CellArea this context was created by

Returns:

#area=(area) ⇒ Gtk::CellArea

The Gtk::CellArea this context was created by

Parameters:

Returns:

#get_allocation(width, height) ⇒ nil

Fetches the current allocation size for context.

If the context was not allocated in width or height, or if the context was recently reset with gtk_cell_area_context_reset(), the returned value will be -1.

Parameters:

  • width (Integer)

    location to store the allocated width, or nil

  • height (Integer)

    location to store the allocated height, or nil

Returns:

  • (nil)

#get_preferred_height(minimum_height, natural_height) ⇒ nil

Gets the accumulative preferred height for all rows which have been requested with this context.

After gtk_cell_area_context_reset() is called and/or before ever requesting the size of a Gtk::CellArea, the returned values are 0.

Parameters:

  • minimum_height (Integer)

    location to store the minimum height, or nil

  • natural_height (Integer)

    location to store the natural height, or nil

Returns:

  • (nil)

#get_preferred_height_for_width(width, minimum_height, natural_height) ⇒ nil

Gets the accumulative preferred height for width for all rows which have been requested for the same said width with this context.

After gtk_cell_area_context_reset() is called and/or before ever requesting the size of a Gtk::CellArea, the returned values are -1.

Parameters:

  • width (Integer)

    a proposed width for allocation

  • minimum_height (Integer)

    location to store the minimum height, or nil

  • natural_height (Integer)

    location to store the natural height, or nil

Returns:

  • (nil)

#get_preferred_width(minimum_width, natural_width) ⇒ nil

Gets the accumulative preferred width for all rows which have been requested with this context.

After gtk_cell_area_context_reset() is called and/or before ever requesting the size of a Gtk::CellArea, the returned values are 0.

Parameters:

  • minimum_width (Integer)

    location to store the minimum width, or nil

  • natural_width (Integer)

    location to store the natural width, or nil

Returns:

  • (nil)

#get_preferred_width_for_height(height, minimum_width, natural_width) ⇒ nil

Gets the accumulative preferred width for height for all rows which have been requested for the same said height with this context.

After gtk_cell_area_context_reset() is called and/or before ever requesting the size of a Gtk::CellArea, the returned values are -1.

Parameters:

  • height (Integer)

    a proposed height for allocation

  • minimum_width (Integer)

    location to store the minimum width, or nil

  • natural_width (Integer)

    location to store the natural width, or nil

Returns:

  • (nil)

#minimum_heightInteger

The minimum height for the Gtk::CellArea in this context for all Gtk::TreeModel rows that this context was requested for using gtk_cell_area_get_preferred_height().

Returns:

  • (Integer)

    minimum-height

#minimum_height=(minimum_height) ⇒ Integer

The minimum height for the Gtk::CellArea in this context for all Gtk::TreeModel rows that this context was requested for using gtk_cell_area_get_preferred_height().

Parameters:

  • minimum_height (Integer)

Returns:

  • (Integer)

    minimum-height

  • (Integer)

    minimum-height

#minimum_widthInteger

The minimum width for the Gtk::CellArea in this context for all Gtk::TreeModel rows that this context was requested for using gtk_cell_area_get_preferred_width().

Returns:

  • (Integer)

    minimum-width

#minimum_width=(minimum_width) ⇒ Integer

The minimum width for the Gtk::CellArea in this context for all Gtk::TreeModel rows that this context was requested for using gtk_cell_area_get_preferred_width().

Parameters:

  • minimum_width (Integer)

Returns:

  • (Integer)

    minimum-width

  • (Integer)

    minimum-width

#natural_heightInteger

The natural height for the Gtk::CellArea in this context for all Gtk::TreeModel rows that this context was requested for using gtk_cell_area_get_preferred_height().

Returns:

  • (Integer)

    natural-height

#natural_height=(natural_height) ⇒ Integer

The natural height for the Gtk::CellArea in this context for all Gtk::TreeModel rows that this context was requested for using gtk_cell_area_get_preferred_height().

Parameters:

  • natural_height (Integer)

Returns:

  • (Integer)

    natural-height

  • (Integer)

    natural-height

#natural_widthInteger

The natural width for the Gtk::CellArea in this context for all Gtk::TreeModel rows that this context was requested for using gtk_cell_area_get_preferred_width().

Returns:

  • (Integer)

    natural-width

#natural_width=(natural_width) ⇒ Integer

The natural width for the Gtk::CellArea in this context for all Gtk::TreeModel rows that this context was requested for using gtk_cell_area_get_preferred_width().

Parameters:

  • natural_width (Integer)

Returns:

  • (Integer)

    natural-width

  • (Integer)

    natural-width

#push_preferred_height(minimum_height, natural_height) ⇒ nil

Causes the minimum and/or natural height to grow if the new proposed sizes exceed the current minimum and natural height.

This is used by Gtk::CellAreaContext implementations during the request process over a series of Gtk::TreeModel rows to progressively push the requested height over a series of gtk_cell_area_get_preferred_height() requests.

Parameters:

  • minimum_height (Integer)

    the proposed new minimum height for context

  • natural_height (Integer)

    the proposed new natural height for context

Returns:

  • (nil)

#push_preferred_width(minimum_width, natural_width) ⇒ nil

Causes the minimum and/or natural width to grow if the new proposed sizes exceed the current minimum and natural width.

This is used by Gtk::CellAreaContext implementations during the request process over a series of Gtk::TreeModel rows to progressively push the requested width over a series of gtk_cell_area_get_preferred_width() requests.

Parameters:

  • minimum_width (Integer)

    the proposed new minimum width for context

  • natural_width (Integer)

    the proposed new natural width for context

Returns:

  • (nil)

#resetnil

Resets any previously cached request and allocation data.

When underlying Gtk::TreeModel data changes its important to reset the context if the content size is allowed to shrink. If the content size is only allowed to grow (this is usually an option for views rendering large data stores as a measure of optimization), then only the row that changed or was inserted needs to be (re)requested with gtk_cell_area_get_preferred_width().

When the new overall size of the context requires that the allocated size changes (or whenever this allocation changes at all), the variable row sizes need to be re-requested for every row.

For instance, if the rows are displayed all with the same width from top to bottom then a change in the allocated width necessitates a recalculation of all the displayed row heights using gtk_cell_area_get_preferred_height_for_width().

Since 3.0

Returns:

  • (nil)