Gtk.CellAreaContext¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
|
||
r |
|
||
r |
|
||
r |
|
||
r |
|
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gtk.CellAreaContext(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Stores geometrical information for a series of rows in a
Gtk.CellAreaThe
GtkCellAreaContextobject is created by a givenGtkCellAreaimplementation via itsGtkCellAreaClass.create_context()virtual method and is used to store cell sizes and alignments for a series ofGtkTreeModelrows that are requested and rendered in the same context.GtkCellLayoutwidgets can create any number of contexts in which to request and render groups of data rows. However, it’s important that the same context which was used to request sizes for a givenGtkTreeModelrow also be used for the same row when calling otherGtkCellAreaAPIs such as gtk_cell_area_render() andGtk.CellArea.event().Deprecated since version 4.10: This object will be removed in GTK 5
- allocate(width, height)[source]¶
- Parameters:
Allocates a width and/or a height for all rows which are to be rendered with self.
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
GtkTreeViewwhenGtkTreeView:fixed-height-modeis enabled.Deprecated since version 4.10: This object will be removed in GTK 5
- get_allocation()[source]¶
- Returns:
- width:
location to store the allocated width
- height:
location to store the allocated height
- Return type:
Fetches the current allocation size for self.
If the context was not allocated in width or height, or if the context was recently reset with
Gtk.CellAreaContext.reset(), the returned value will be -1.Deprecated since version 4.10: This object will be removed in GTK 5
- get_area()[source]¶
- Returns:
the
GtkCellAreathis context was created by.- Return type:
Fetches the
GtkCellAreathis self was created by.This is generally unneeded by layouting widgets; however, it is important for the context implementation itself to fetch information about the area it is being used for.
For instance at
GtkCellAreaContextClass.allocate()time it’s important to know details about any cell spacing that theGtkCellAreais configured with in order to compute a proper allocation.Deprecated since version 4.10: This object will be removed in GTK 5
- get_preferred_height()[source]¶
- Returns:
- minimum_height:
location to store the minimum height
- natural_height:
location to store the natural height
- Return type:
Gets the accumulative preferred height for all rows which have been requested with this context.
After
Gtk.CellAreaContext.reset() is called and/or before ever requesting the size of aGtkCellArea, the returned values are 0.Deprecated since version 4.10: This object will be removed in GTK 5
- get_preferred_height_for_width(width)[source]¶
- Parameters:
width (
int) – a proposed width for allocation- Returns:
- minimum_height:
location to store the minimum height
- natural_height:
location to store the natural height
- Return type:
Gets the accumulative preferred height for width for all rows which have been requested for the same said width with this context.
After
Gtk.CellAreaContext.reset() is called and/or before ever requesting the size of aGtkCellArea, the returned values are -1.Deprecated since version 4.10: This object will be removed in GTK 5
- get_preferred_width()[source]¶
- Returns:
- minimum_width:
location to store the minimum width
- natural_width:
location to store the natural width
- Return type:
Gets the accumulative preferred width for all rows which have been requested with this context.
After
Gtk.CellAreaContext.reset() is called and/or before ever requesting the size of aGtkCellArea, the returned values are 0.Deprecated since version 4.10: This object will be removed in GTK 5
- get_preferred_width_for_height(height)[source]¶
- Parameters:
height (
int) – a proposed height for allocation- Returns:
- minimum_width:
location to store the minimum width
- natural_width:
location to store the natural width
- Return type:
Gets the accumulative preferred width for height for all rows which have been requested for the same said height with this context.
After
Gtk.CellAreaContext.reset() is called and/or before ever requesting the size of aGtkCellArea, the returned values are -1.Deprecated since version 4.10: This object will be removed in GTK 5
- push_preferred_height(minimum_height, natural_height)[source]¶
- Parameters:
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
GtkCellAreaContextimplementations during the request process over a series ofGtkTreeModelrows to progressively push the requested height over a series ofGtk.CellArea.get_preferred_height() requests.Deprecated since version 4.10: This object will be removed in GTK 5
- push_preferred_width(minimum_width, natural_width)[source]¶
- Parameters:
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
GtkCellAreaContextimplementations during the request process over a series ofGtkTreeModelrows to progressively push the requested width over a series ofGtk.CellArea.get_preferred_width() requests.Deprecated since version 4.10: This object will be removed in GTK 5
- reset()[source]¶
Resets any previously cached request and allocation data.
When underlying
GtkTreeModeldata 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 withGtk.CellArea.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.CellArea.get_preferred_height_for_width().Deprecated since version 4.10: This object will be removed in GTK 5
- do_allocate(width, height) virtual¶
- Parameters:
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
GtkTreeViewwhenGtkTreeView:fixed-height-modeis enabled.Deprecated since version 4.10: This object will be removed in GTK 5
- do_get_preferred_height_for_width(width) virtual¶
- Parameters:
width (
int) – a proposed width for allocation- Returns:
- minimum_height:
location to store the minimum height
- natural_height:
location to store the natural height
- Return type:
Gets the accumulative preferred height for width for all rows which have been requested for the same said width with this context.
After
Gtk.CellAreaContext.reset() is called and/or before ever requesting the size of aGtkCellArea, the returned values are -1.Deprecated since version 4.10: This object will be removed in GTK 5
- do_get_preferred_width_for_height(height) virtual¶
- Parameters:
height (
int) – a proposed height for allocation- Returns:
- minimum_width:
location to store the minimum width
- natural_width:
location to store the natural width
- Return type:
Gets the accumulative preferred width for height for all rows which have been requested for the same said height with this context.
After
Gtk.CellAreaContext.reset() is called and/or before ever requesting the size of aGtkCellArea, the returned values are -1.Deprecated since version 4.10: This object will be removed in GTK 5
- do_reset() virtual¶
Resets any previously cached request and allocation data.
When underlying
GtkTreeModeldata 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 withGtk.CellArea.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.CellArea.get_preferred_height_for_width().Deprecated since version 4.10: This object will be removed in GTK 5
Property Details¶
- Gtk.CellAreaContext.props.area¶
- Name:
area- Type:
- Default Value:
- Flags:
The
GtkCellAreathis context was created byDeprecated since version 4.10: This object will be removed in GTK 5
- Gtk.CellAreaContext.props.minimum_height¶
-
The minimum height for the
GtkCellAreain this context for allGtkTreeModelrows that this context was requested for usingGtk.CellArea.get_preferred_height().Deprecated since version 4.10: This object will be removed in GTK 5
- Gtk.CellAreaContext.props.minimum_width¶
-
The minimum width for the
GtkCellAreain this context for allGtkTreeModelrows that this context was requested for usingGtk.CellArea.get_preferred_width().Deprecated since version 4.10: This object will be removed in GTK 5
- Gtk.CellAreaContext.props.natural_height¶
-
The natural height for the
GtkCellAreain this context for allGtkTreeModelrows that this context was requested for usingGtk.CellArea.get_preferred_height().Deprecated since version 4.10: This object will be removed in GTK 5
- Gtk.CellAreaContext.props.natural_width¶
-
The natural width for the
GtkCellAreain this context for allGtkTreeModelrows that this context was requested for usingGtk.CellArea.get_preferred_width().Deprecated since version 4.10: This object will be removed in GTK 5