pub trait Tab {
    fn ui(&mut self, ui: &mut Ui);
    fn title(&mut self) -> WidgetText;

    fn on_close(&mut self) -> bool { ... }
    fn force_close(&mut self) -> bool { ... }
    fn inner_margin(&self) -> Margin { ... }
}
Expand description

Dockable tab that can be used in crate::Trees.

Required Methods

Actual tab content.

The title to be displayed.

Provided Methods

This is called when the tabs close button is pressed.

Returns true if the tab should close immediately, false otherwise.

NOTE if returning false ui will still be called once more if this tab is active.

This is called every frame after ui is called (if the tab is active).

Returns true if the tab should be forced to close, false otherwise.

In the event this function returns true the tab will be removed without calling on_close.

Sets the margins between tab’s borders and its contents.

Implementors