Struct egui::containers::panel::CentralPanel
source · pub struct CentralPanel {
frame: Option<Frame>,
}
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 Window
s and 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!");
});
Fields§
§frame: Option<Frame>
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
.
sourcefn show_inside_dyn<'c, R>(
self,
ui: &mut Ui,
add_contents: Box<dyn FnOnce(&mut Ui) -> R + 'c>,
) -> InnerResponse<R>
fn show_inside_dyn<'c, R>( self, ui: &mut Ui, add_contents: Box<dyn FnOnce(&mut Ui) -> R + 'c>, ) -> 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