Skip to main content

TableBuilder

Struct TableBuilder 

Source
pub struct TableBuilder { /* private fields */ }

Implementations§

Source§

impl TableBuilder

Source

pub fn new() -> Self

Source

pub fn fade_color(self, c: Color) -> Self

Set the scroll-fade gradient colour on the body’s inner ScrollView. Pass the visible ancestor background colour (e.g. Visuals::panel_fill when the table sits on a panel) so the fade dissolves invisibly instead of painting a bright halo of the default window_fill. See ScrollView::with_fade_color.

Source

pub fn columns(self, cols: Vec<TableColumn>) -> Self

Source

pub fn striped(self, on: bool) -> Self

Source

pub fn striped_cell(self, cell: Rc<Cell<bool>>) -> Self

Source

pub fn sense_click(self, on: bool) -> Self

Source

pub fn sense_click_cell(self, cell: Rc<Cell<bool>>) -> Self

Source

pub fn rows(self, spec: TableRows) -> Self

Source

pub fn rows_cell(self, cell: Rc<RefCell<TableRows>>) -> Self

Source

pub fn rows_provider(self, p: RowsProvider) -> Self

Install a closure that produces the current row spec. The widget invokes it during each layout pass and writes the result into the internal rows cell, so external state changes flow in without the caller having to manage an observer widget.

Source

pub fn overline_pred(self, pred: RowPredicate) -> Self

Source

pub fn selection(self, sel: Rc<RefCell<HashSet<usize>>>) -> Self

Use a HashSet<usize> as the selection mask (highlights any row whose internal index is in the set). Convenience over Self::selection_pred for the common case where rows are not reversed/transformed.

Source

pub fn selection_pred(self, pred: RowPredicate) -> Self

Pass an arbitrary predicate to compute “is row N selected?”. Useful when display indices differ from internal indices (e.g. reversed order) and the caller wants the highlight to track the display index rather than the internal one.

Source

pub fn resizable(self, on: bool) -> Self

Source

pub fn resizable_cell(self, cell: Rc<Cell<bool>>) -> Self

Source

pub fn column_overrides_cell(self, cell: Rc<RefCell<Vec<Option<f64>>>>) -> Self

Adopt an external Rc<RefCell<Vec<Option<f64>>>> as the column overrides cell. External code can clear it (e.g. on a Reset button) to restore the configured widths.

Source

pub fn scroll_to_row_cell(self, cell: Rc<Cell<Option<usize>>>) -> Self

Source

pub fn scroll_offset_cell(self, cell: Rc<Cell<f64>>) -> Self

Source

pub fn header_height(self, h: f64) -> Self

Source

pub fn header_painter(self, p: HeaderPainter) -> Self

Source

pub fn header_click(self, p: HeaderClick) -> Self

Source

pub fn cell_painter(self, p: CellPainter) -> Self

Source

pub fn on_row_click(self, f: Box<dyn FnMut(usize, usize)>) -> Self

Source

pub fn build(self, font: Arc<Font>) -> Table

Materialise the configured table into a widget.

Trait Implementations§

Source§

impl Default for TableBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.