gtk4::prelude

Trait CellAreaContextExt

Source
pub trait CellAreaContextExt:
    IsA<CellAreaContext>
    + Sealed
    + 'static {
Show 18 methods // Provided methods fn allocate(&self, width: i32, height: i32) { ... } fn allocation(&self) -> (i32, i32) { ... } fn area(&self) -> CellArea { ... } fn preferred_height(&self) -> (i32, i32) { ... } fn preferred_height_for_width(&self, width: i32) -> (i32, i32) { ... } fn preferred_width(&self) -> (i32, i32) { ... } fn preferred_width_for_height(&self, height: i32) -> (i32, i32) { ... } fn push_preferred_height(&self, minimum_height: i32, natural_height: i32) { ... } fn push_preferred_width(&self, minimum_width: i32, natural_width: i32) { ... } fn reset(&self) { ... } fn minimum_height(&self) -> i32 { ... } fn minimum_width(&self) -> i32 { ... } fn natural_height(&self) -> i32 { ... } fn natural_width(&self) -> i32 { ... } fn connect_minimum_height_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_minimum_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_natural_height_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_natural_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
👎Deprecated: Since 4.10
Expand description

Trait containing all CellAreaContext methods.

§Implementors

CellAreaContext

Provided Methods§

Source

fn allocate(&self, width: i32, height: i32)

👎Deprecated: Since 4.10

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 TreeView when GtkTreeView:fixed-height-mode is enabled.

§Deprecated since 4.10

This object will be removed in GTK 5

§width

the allocated width for all TreeModel rows rendered with @self, or -1

§height

the allocated height for all TreeModel rows rendered with @self, or -1

Source

fn allocation(&self) -> (i32, i32)

👎Deprecated: Since 4.10

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_cell_area_context_reset(), the returned value will be -1.

§Deprecated since 4.10

This object will be removed in GTK 5

§Returns
§width

location to store the allocated width

§height

location to store the allocated height

Source

fn area(&self) -> CellArea

👎Deprecated: Since 4.10

Fetches the CellArea this @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 the CellArea is configured with in order to compute a proper allocation.

§Deprecated since 4.10

This object will be removed in GTK 5

§Returns

the CellArea this context was created by.

Source

fn preferred_height(&self) -> (i32, i32)

👎Deprecated: Since 4.10

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 CellArea, the returned values are 0.

§Deprecated since 4.10

This object will be removed in GTK 5

§Returns
§minimum_height

location to store the minimum height

§natural_height

location to store the natural height

Source

fn preferred_height_for_width(&self, width: i32) -> (i32, i32)

👎Deprecated: Since 4.10

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 CellArea, the returned values are -1.

§Deprecated since 4.10

This object will be removed in GTK 5

§width

a proposed width for allocation

§Returns
§minimum_height

location to store the minimum height

§natural_height

location to store the natural height

Source

fn preferred_width(&self) -> (i32, i32)

👎Deprecated: Since 4.10

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 CellArea, the returned values are 0.

§Deprecated since 4.10

This object will be removed in GTK 5

§Returns
§minimum_width

location to store the minimum width

§natural_width

location to store the natural width

Source

fn preferred_width_for_height(&self, height: i32) -> (i32, i32)

👎Deprecated: Since 4.10

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 CellArea, the returned values are -1.

§Deprecated since 4.10

This object will be removed in GTK 5

§height

a proposed height for allocation

§Returns
§minimum_width

location to store the minimum width

§natural_width

location to store the natural width

Source

fn push_preferred_height(&self, minimum_height: i32, natural_height: i32)

👎Deprecated: Since 4.10

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 CellAreaContext implementations during the request process over a series of TreeModel rows to progressively push the requested height over a series of gtk_cell_area_get_preferred_height() requests.

§Deprecated since 4.10

This object will be removed in GTK 5

§minimum_height

the proposed new minimum height for @self

§natural_height

the proposed new natural height for @self

Source

fn push_preferred_width(&self, minimum_width: i32, natural_width: i32)

👎Deprecated: Since 4.10

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 CellAreaContext implementations during the request process over a series of TreeModel rows to progressively push the requested width over a series of gtk_cell_area_get_preferred_width() requests.

§Deprecated since 4.10

This object will be removed in GTK 5

§minimum_width

the proposed new minimum width for @self

§natural_width

the proposed new natural width for @self

Source

fn reset(&self)

👎Deprecated: Since 4.10

Resets any previously cached request and allocation data.

When underlying 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().

§Deprecated since 4.10

This object will be removed in GTK 5

Source

fn minimum_height(&self) -> i32

👎Deprecated: Since 4.10

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

§Deprecated since 4.10

This object will be removed in GTK 5

Source

fn minimum_width(&self) -> i32

👎Deprecated: Since 4.10

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

§Deprecated since 4.10

This object will be removed in GTK 5

Source

fn natural_height(&self) -> i32

👎Deprecated: Since 4.10

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

§Deprecated since 4.10

This object will be removed in GTK 5

Source

fn natural_width(&self) -> i32

👎Deprecated: Since 4.10

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

§Deprecated since 4.10

This object will be removed in GTK 5

Source

fn connect_minimum_height_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

👎Deprecated: Since 4.10
Source

fn connect_minimum_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

👎Deprecated: Since 4.10
Source

fn connect_natural_height_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

👎Deprecated: Since 4.10
Source

fn connect_natural_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

👎Deprecated: Since 4.10

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§