Trait gtk::prelude::CellAreaContextExt [−][src]
pub trait CellAreaContextExt: 'static {}Show methods
fn allocate(&self, width: i32, height: i32); fn allocation(&self) -> (i32, i32); fn area(&self) -> Option<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;
Expand description
Required methods
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
property::TreeView::fixed-height-mode
is enabled.
Since 3.0
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.
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.
Returns
the CellArea
this context was created by.
Gets the accumulative preferred height for all rows which have been requested with this context.
After reset()
is called and/or before ever
requesting the size of a CellArea
, the returned values are 0.
Returns
minimum_height
location to store the minimum height,
or None
natural_height
location to store the natural height,
or None
Gets the accumulative preferred height for width
for all rows
which have been requested for the same said width
with this context.
After reset()
is called and/or before ever
requesting the size of a CellArea
, the returned values are -1.
width
a proposed width for allocation
Returns
minimum_height
location to store the minimum height,
or None
natural_height
location to store the natural height,
or None
Gets the accumulative preferred width for all rows which have been requested with this context.
After reset()
is called and/or before ever
requesting the size of a CellArea
, the returned values are 0.
Returns
minimum_width
location to store the minimum width,
or None
natural_width
location to store the natural width,
or None
Gets the accumulative preferred width for height
for all rows which
have been requested for the same said height
with this context.
After reset()
is called and/or before ever
requesting the size of a CellArea
, the returned values are -1.
height
a proposed height for allocation
Returns
minimum_width
location to store the minimum width,
or None
natural_width
location to store the natural width,
or None
fn push_preferred_height(&self, minimum_height: i32, natural_height: i32)
fn push_preferred_height(&self, minimum_height: i32, natural_height: i32)
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
CellAreaExt::preferred_height()
requests.
minimum_height
the proposed new minimum height for self
natural_height
the proposed new natural height for self
fn push_preferred_width(&self, minimum_width: i32, natural_width: i32)
fn push_preferred_width(&self, minimum_width: i32, natural_width: i32)
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
CellAreaExt::preferred_width()
requests.
minimum_width
the proposed new minimum width for self
natural_width
the proposed new natural width for self
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
CellAreaExt::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
CellAreaExt::preferred_height_for_width()
.
Since 3.0
fn minimum_height(&self) -> i32
fn minimum_height(&self) -> i32
The minimum height for the CellArea
in this context
for all TreeModel
rows that this context was requested
for using CellAreaExt::preferred_height()
.
fn minimum_width(&self) -> i32
fn minimum_width(&self) -> i32
The minimum width for the CellArea
in this context
for all TreeModel
rows that this context was requested
for using CellAreaExt::preferred_width()
.
fn natural_height(&self) -> i32
fn natural_height(&self) -> i32
The natural height for the CellArea
in this context
for all TreeModel
rows that this context was requested
for using CellAreaExt::preferred_height()
.
fn natural_width(&self) -> i32
fn natural_width(&self) -> i32
The natural width for the CellArea
in this context
for all TreeModel
rows that this context was requested
for using CellAreaExt::preferred_width()
.
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