[][src]Trait gtk::GridExt

pub trait GridExt: 'static {
    fn attach<P: IsA<Widget>>(
        &self,
        child: &P,
        left: i32,
        top: i32,
        width: i32,
        height: i32
    );
fn attach_next_to<P: IsA<Widget>, Q: IsA<Widget>>(
        &self,
        child: &P,
        sibling: Option<&Q>,
        side: PositionType,
        width: i32,
        height: i32
    );
fn get_baseline_row(&self) -> i32;
fn get_child_at(&self, left: i32, top: i32) -> Option<Widget>;
fn get_column_homogeneous(&self) -> bool;
fn get_column_spacing(&self) -> u32;
fn get_row_baseline_position(&self, row: i32) -> BaselinePosition;
fn get_row_homogeneous(&self) -> bool;
fn get_row_spacing(&self) -> u32;
fn insert_column(&self, position: i32);
fn insert_next_to<P: IsA<Widget>>(&self, sibling: &P, side: PositionType);
fn insert_row(&self, position: i32);
fn remove_column(&self, position: i32);
fn remove_row(&self, position: i32);
fn set_baseline_row(&self, row: i32);
fn set_column_homogeneous(&self, homogeneous: bool);
fn set_column_spacing(&self, spacing: u32);
fn set_row_baseline_position(&self, row: i32, pos: BaselinePosition);
fn set_row_homogeneous(&self, homogeneous: bool);
fn set_row_spacing(&self, spacing: u32);
fn get_cell_height<T: IsA<Widget>>(&self, item: &T) -> i32;
fn set_cell_height<T: IsA<Widget>>(&self, item: &T, height: i32);
fn get_cell_width<T: IsA<Widget>>(&self, item: &T) -> i32;
fn set_cell_width<T: IsA<Widget>>(&self, item: &T, width: i32);
fn get_cell_left_attach<T: IsA<Widget>>(&self, item: &T) -> i32;
fn set_cell_left_attach<T: IsA<Widget>>(&self, item: &T, left_attach: i32);
fn get_cell_top_attach<T: IsA<Widget>>(&self, item: &T) -> i32;
fn set_cell_top_attach<T: IsA<Widget>>(&self, item: &T, top_attach: i32);
fn connect_property_baseline_row_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
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_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; }

Trait containing all Grid methods.

Implementors

Grid

Required methods

fn attach<P: IsA<Widget>>(
    &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 widget 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

fn attach_next_to<P: IsA<Widget>, Q: IsA<Widget>>(
    &self,
    child: &P,
    sibling: Option<&Q>,
    side: PositionType,
    width: i32,
    height: i32
)

Adds a widget to the grid.

The widget is placed next to sibling, on the side determined by side. When sibling is None, the widget 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 == PositionType::Left yields a layout of [3][2][1].

child

the widget 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

fn get_baseline_row(&self) -> i32

Returns which row defines the global baseline of self.

Returns

the row index defining the global baseline

fn get_child_at(&self, left: i32, top: i32) -> Option<Widget>

Gets the child of self whose area covers the grid cell whose upper left corner is at left, top.

left

the left edge of the cell

top

the top edge of the cell

Returns

the child at the given position, or None

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.

fn get_column_spacing(&self) -> u32

Returns the amount of space between the columns of self.

Returns

the column spacing of self

fn get_row_baseline_position(&self, row: i32) -> BaselinePosition

Returns the baseline position of row as set by GridExt::set_row_baseline_position or the default value BaselinePosition::Center.

row

a row index

Returns

the baseline position of row

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.

fn get_row_spacing(&self) -> u32

Returns the amount of space between the rows of self.

Returns

the row spacing of self

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

fn insert_next_to<P: IsA<Widget>>(&self, sibling: &P, side: PositionType)

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 PositionType::Top or PositionType::Bottom, a row is inserted. If side is PositionType::Left of PositionType::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

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

fn remove_column(&self, position: i32)

Removes a column from the grid.

Children that are placed in this column are removed, spanning children that overlap this column have their width reduced by one, and children after the column are moved to the left.

position

the position of the column to remove

fn remove_row(&self, position: i32)

Removes a row from the grid.

Children that are placed in this row are removed, spanning children that overlap this row have their height reduced by one, and children below the row are moved up.

position

the position of the row to remove

fn set_baseline_row(&self, row: i32)

Sets which row defines the global baseline for the entire grid. Each row in the grid can have its own local baseline, but only one of those is global, meaning it will be the baseline in the parent of the self.

row

the row index

fn set_column_homogeneous(&self, homogeneous: bool)

Sets whether all columns of self will have the same width.

homogeneous

true to make columns homogeneous

fn set_column_spacing(&self, spacing: u32)

Sets the amount of space between columns of self.

spacing

the amount of space to insert between columns

fn set_row_baseline_position(&self, row: i32, pos: BaselinePosition)

Sets how the baseline should be positioned on row of the grid, in case that row is assigned more space than is requested.

row

a row index

pos

a BaselinePosition

fn set_row_homogeneous(&self, homogeneous: bool)

Sets whether all rows of self will have the same height.

homogeneous

true to make rows homogeneous

fn set_row_spacing(&self, spacing: u32)

Sets the amount of space between rows of self.

spacing

the amount of space to insert between rows

fn get_cell_height<T: IsA<Widget>>(&self, item: &T) -> i32

fn set_cell_height<T: IsA<Widget>>(&self, item: &T, height: i32)

fn get_cell_width<T: IsA<Widget>>(&self, item: &T) -> i32

fn set_cell_width<T: IsA<Widget>>(&self, item: &T, width: i32)

fn get_cell_left_attach<T: IsA<Widget>>(&self, item: &T) -> i32

fn set_cell_left_attach<T: IsA<Widget>>(&self, item: &T, left_attach: i32)

fn get_cell_top_attach<T: IsA<Widget>>(&self, item: &T) -> i32

fn set_cell_top_attach<T: IsA<Widget>>(&self, item: &T, top_attach: i32)

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

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_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

Loading content...

Implementors

impl<O: IsA<Grid>> GridExt for O[src]

Loading content...