Skip to main content

cell

Function cell 

Source
pub fn cell<R>(
    ui: &mut Ui,
    part: Option<CellPart>,
    palette: &Palette,
    add_contents: impl FnOnce(&mut Ui) -> R,
) -> R
Expand description

Draw a cell’s contents with the tone its part takes.

The app calls this inside its own cell closure, wrapping whatever it draws. A scoping function rather than a parameter on table, for the reason frame is one: the part is a property of the cell, the cell does not exist until the closure runs, and immediate mode has no cascade to carry the answer down on its own. This is the cascade, for one scope.

makeover_immediate::table::cell(ui, Some(CellPart::Link), &palette, |ui| {
    ui.label("opens the item");
});