pub struct MacTableView<'a> { /* private fields */ }Expand description
Authentic macOS AppKit multi-column data table (NSTableView equivalent).
§Example
use egui_macview::{MacSortDirection, MacTableColumn, MacTableView, MacTheme};
use std::collections::BTreeSet;
let theme = MacTheme::default();
let mut selection = BTreeSet::from([0]);
let cols = [
MacTableColumn::new("Name", 140.0).sort(Some(MacSortDirection::Ascending)),
MacTableColumn::new("Duration", 80.0),
];
MacTableView::new("media_table", &cols, 3, &mut selection)
.theme(&theme)
.uses_alternating_row_backgrounds(true)
.show(ui, |cell_ui, row, col| {
cell_ui.label(format!("Cell ({row}, {col})"));
});Implementations§
Source§impl<'a> MacTableView<'a>
impl<'a> MacTableView<'a>
Sourcepub fn new(
id_source: impl Hash + Debug,
columns: &'a [MacTableColumn<'a>],
row_count: usize,
selection: &'a mut BTreeSet<usize>,
) -> Self
pub fn new( id_source: impl Hash + Debug, columns: &'a [MacTableColumn<'a>], row_count: usize, selection: &'a mut BTreeSet<usize>, ) -> Self
Creates a new MacTableView with columns, row_count, and mutable selection set.
Sourcepub fn uses_alternating_row_backgrounds(self, alternating: bool) -> Self
pub fn uses_alternating_row_backgrounds(self, alternating: bool) -> Self
Configures usesAlternatingRowBackgroundColors.
Sourcepub fn row_height(self, height: f32) -> Self
pub fn row_height(self, height: f32) -> Self
Overrides default row height in points.
Auto Trait Implementations§
impl<'a> !UnwindSafe for MacTableView<'a>
impl<'a> Forget for MacTableView<'a>
impl<'a> Freeze for MacTableView<'a>
impl<'a> RefUnwindSafe for MacTableView<'a>
impl<'a> Send for MacTableView<'a>
impl<'a> Sync for MacTableView<'a>
impl<'a> Unpin for MacTableView<'a>
impl<'a> UnsafeUnpin for MacTableView<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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