Skip to content

CentralPanel not display #390

@pulsexlb

Description

@pulsexlb

i'm trying to create an Area by

let area = egui::Area::new(“areaid”)
    .movable(true)
    .kind(UiKind::Window)
    .default_size((200., 100.));
area.show(contexts.ctx_mut(), |ui| {
    // title bar
    egui::TopBottomPanel::top(format!("titlebar", entity)).show_inside(ui, |ui| {
        ui.label("1"); // display normally
    });
    // context
    egui::CentralPanel::default().show_inside(ui, |ui| {
        ui.label("2"); // not displayed
    });
});

but CentralPanel did not displayed

i found that the problem seems to be that CentralPanel has not obtained any space. If I add some content after CentralPanel (such as some empty labels), this part of CentralPanel will be displayed normally (overlapping with these added labels).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions