Struct egui::containers::CollapsingHeader[][src]

pub struct CollapsingHeader { /* fields omitted */ }

A header which can be collapsed/expanded, revealing a contained Ui region.

egui::CollapsingHeader::new("Heading")
    .show(ui, |ui| {
        ui.label("Contents");
    });

// Short version:
ui.collapsing("Heading", |ui| { ui.label("Contents"); });

Implementations

impl CollapsingHeader[src]

pub fn new(label: impl Into<String>) -> Self[src]

The CollapsingHeader starts out collapsed unless you call default_open.

The label is used as an Id source. If the label is unique and static this is fine, but if it changes or there are several CollapsingHeader with the same title you need to provide a unique id source with Self::id_source.

pub fn default_open(self, open: bool) -> Self[src]

By default, the CollapsingHeader is collapsed. Call .default_open(true) to change this.

pub fn id_source(self, id_source: impl Hash) -> Self[src]

Explicitly set the source of the Id of this widget, instead of using title label. This is useful if the title label is dynamic or not unique.

impl CollapsingHeader[src]

pub fn show<R>(
    self,
    ui: &mut Ui,
    add_contents: impl FnOnce(&mut Ui) -> R
) -> CollapsingResponse<R>
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.