pub trait GridLayoutExt: 'static {
Show 21 methods
// Required methods
fn attach<P: IsA<Actor>>(
&self,
child: &P,
left: i32,
top: i32,
width: i32,
height: i32,
);
fn attach_next_to<P: IsA<Actor>, Q: IsA<Actor>>(
&self,
child: &P,
sibling: Option<&Q>,
side: GridPosition,
width: i32,
height: i32,
);
fn get_child_at(&self, left: i32, top: i32) -> Option<Actor>;
fn get_column_homogeneous(&self) -> bool;
fn get_column_spacing(&self) -> u32;
fn get_orientation(&self) -> Orientation;
fn get_row_homogeneous(&self) -> bool;
fn get_row_spacing(&self) -> u32;
fn insert_column(&self, position: i32);
fn insert_next_to<P: IsA<Actor>>(&self, sibling: &P, side: GridPosition);
fn insert_row(&self, position: i32);
fn set_column_homogeneous(&self, homogeneous: bool);
fn set_column_spacing(&self, spacing: u32);
fn set_orientation(&self, orientation: Orientation);
fn set_row_homogeneous(&self, homogeneous: bool);
fn set_row_spacing(&self, spacing: u32);
fn connect_property_column_homogeneous_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_column_spacing_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_orientation_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_row_homogeneous_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_row_spacing_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
Expand description
Required Methods§
Sourcefn attach<P: IsA<Actor>>(
&self,
child: &P,
left: i32,
top: i32,
width: i32,
height: i32,
)
fn attach<P: IsA<Actor>>( &self, child: &P, left: i32, top: i32, width: i32, height: i32, )
Adds a widget to the grid.
The position of child
is determined by left
and top
. The
number of ‘cells’ that child
will occupy is determined by
width
and height
.
§child
the Actor
to add
§left
the column number to attach the left side of child
to
§top
the row number to attach the top side of child
to
§width
the number of columns that child
will span
§height
the number of rows that child
will span
Sourcefn attach_next_to<P: IsA<Actor>, Q: IsA<Actor>>(
&self,
child: &P,
sibling: Option<&Q>,
side: GridPosition,
width: i32,
height: i32,
)
fn attach_next_to<P: IsA<Actor>, Q: IsA<Actor>>( &self, child: &P, sibling: Option<&Q>, side: GridPosition, width: i32, height: i32, )
Adds a actor to the grid.
The actor is placed next to sibling
, on the side determined by
side
. When sibling
is None
, the actor is placed in row (for
left or right placement) or column 0 (for top or bottom placement),
at the end indicated by side
.
Attaching widgets labeled [1], [2], [3] with sibling
== None
and
side
== GridPosition::Left
yields a layout of [3][2][1].
§child
the actor to add
§sibling
the child of self
that child
will be placed
next to, or None
to place child
at the beginning or end
§side
the side of sibling
that child
is positioned next to
§width
the number of columns that child
will span
§height
the number of rows that child
will span
Sourcefn get_column_homogeneous(&self) -> bool
fn get_column_homogeneous(&self) -> bool
Returns whether all columns of self
have the same width.
§Returns
whether all columns of self
have the same width.
Sourcefn get_column_spacing(&self) -> u32
fn get_column_spacing(&self) -> u32
Retrieves the spacing set using GridLayoutExt::set_column_spacing
§Returns
the spacing between coluns of self
Sourcefn get_orientation(&self) -> Orientation
fn get_orientation(&self) -> Orientation
Sourcefn get_row_homogeneous(&self) -> bool
fn get_row_homogeneous(&self) -> bool
Returns whether all rows of self
have the same height.
§Returns
whether all rows of self
have the same height.
Sourcefn get_row_spacing(&self) -> u32
fn get_row_spacing(&self) -> u32
Retrieves the spacing set using GridLayoutExt::set_row_spacing
§Returns
the spacing between rows of self
Sourcefn insert_column(&self, position: i32)
fn insert_column(&self, position: i32)
Inserts a column at the specified position.
Children which are attached at or to the right of this position are moved one column to the right. Children which span across this position are grown to span the new column.
§position
the position to insert the column at
Sourcefn insert_next_to<P: IsA<Actor>>(&self, sibling: &P, side: GridPosition)
fn insert_next_to<P: IsA<Actor>>(&self, sibling: &P, side: GridPosition)
Inserts a row or column at the specified position.
The new row or column is placed next to sibling
, on the side
determined by side
. If side
is GridPosition::Left
or
GridPosition::Bottom
, a row is inserted. If side
is
GridPosition::Left
of GridPosition::Right
,
a column is inserted.
§sibling
the child of self
that the new row or column will be
placed next to
§side
the side of sibling
that child
is positioned next to
Sourcefn insert_row(&self, position: i32)
fn insert_row(&self, position: i32)
Inserts a row at the specified position.
Children which are attached at or below this position are moved one row down. Children which span across this position are grown to span the new row.
§position
the position to insert the row at
Sourcefn set_column_homogeneous(&self, homogeneous: bool)
fn set_column_homogeneous(&self, homogeneous: bool)
Sets whether all columns of self
will have the same width.
§homogeneous
true
to make columns homogeneous
Sourcefn set_column_spacing(&self, spacing: u32)
fn set_column_spacing(&self, spacing: u32)
Sets the spacing between columns of self
§spacing
the spacing between columns of the layout, in pixels
Sourcefn set_orientation(&self, orientation: Orientation)
fn set_orientation(&self, orientation: Orientation)
Sets the orientation of the self
.
GridLayout
uses the orientation as a hint when adding
children to the Actor
using it as a layout manager via
ActorExt::add_child
; changing this value will not have
any effect on children that are already part of the layout.
§orientation
the orientation of the GridLayout
Sourcefn set_row_homogeneous(&self, homogeneous: bool)
fn set_row_homogeneous(&self, homogeneous: bool)
Sourcefn set_row_spacing(&self, spacing: u32)
fn set_row_spacing(&self, spacing: u32)
fn connect_property_column_homogeneous_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_property_column_spacing_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_property_orientation_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_property_row_homogeneous_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_property_row_spacing_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
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.