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.
This acts very similar to Frame::central_panel, but always expands
to use up all available space.
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::Windows and crate::Areas will cover the top-level CentralPanel.
See the module level docs for more details.
egui::Panel::top("my_panel").show(ui, |ui| {
ui.label("Hello World! From `Panel`, that must be before `CentralPanel`!");
});
egui::CentralPanel::default().show(ui, |ui| {
ui.label("Hello World!");
});Implementations§
Source§impl CentralPanel
impl CentralPanel
Sourcepub fn default_margins() -> Self
pub fn default_margins() -> Self
A central panel with a background color and some inner margins
Sourcepub fn show<R>(
self,
ui: &mut Ui,
add_contents: impl FnOnce(&mut Ui) -> R,
) -> InnerResponse<R>
pub fn show<R>( self, ui: &mut Ui, add_contents: impl FnOnce(&mut Ui) -> R, ) -> InnerResponse<R>
Show the panel inside a Ui.
Sourcepub fn show_inside<R>(
self,
ui: &mut Ui,
add_contents: impl FnOnce(&mut Ui) -> R,
) -> InnerResponse<R>
👎Deprecated: Renamed to show
pub fn show_inside<R>( self, ui: &mut Ui, add_contents: impl FnOnce(&mut Ui) -> R, ) -> InnerResponse<R>
Renamed to show
Renamed to Self::show.
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 UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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