pub struct CentralPanel { /* private fields */ }
Expand description
A panel that covers the remainder of the screen, i.e. whatever area is left after adding other panels.
The order in which you add panels matter! The first panel you add will always be the outermost, and the last you add will always be the innermost.
⚠ CentralPanel
must be added after all other panels!
NOTE: Any crate::Window
s and crate::Area
s will cover the top-level CentralPanel
.
See the module level docs for more details.
egui::TopBottomPanel::top("my_panel").show(ctx, |ui| {
ui.label("Hello World! From `TopBottomPanel`, that must be before `CentralPanel`!");
});
egui::CentralPanel::default().show(ctx, |ui| {
ui.label("Hello World!");
});
Implementations§
source§impl CentralPanel
impl CentralPanel
source§impl CentralPanel
impl CentralPanel
sourcepub fn show_inside<R>(
self,
ui: &mut Ui,
add_contents: impl FnOnce(&mut Ui) -> R,
) -> InnerResponse<R>
pub fn show_inside<R>( self, ui: &mut Ui, add_contents: impl FnOnce(&mut Ui) -> R, ) -> InnerResponse<R>
Show the panel inside a Ui
.
Trait Implementations§
source§impl Default for CentralPanel
impl Default for CentralPanel
source§fn default() -> CentralPanel
fn default() -> CentralPanel
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CentralPanel
impl RefUnwindSafe for CentralPanel
impl Send for CentralPanel
impl Sync for CentralPanel
impl Unpin for CentralPanel
impl UnwindSafe for CentralPanel
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
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