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::Tree
s.
Required Methods
sourcefn title(&mut self) -> WidgetText
fn title(&mut self) -> WidgetText
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.
sourcefn force_close(&mut self) -> bool
fn force_close(&mut self) -> bool
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
.
sourcefn inner_margin(&self) -> Margin
fn inner_margin(&self) -> Margin
Sets the margins between tab’s borders and its contents.