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).
i'm trying to create an
Areabybut
CentralPaneldid not displayedi found that the problem seems to be that
CentralPanelhas not obtained any space. If I add some content afterCentralPanel(such as some emptylabels), this part ofCentralPanelwill be displayed normally (overlapping with these addedlabels).