Warning
This post was published 45 days ago. The information described in this article may have changed.
How to change one window content to another one?
I know I should use app state and somehow operate it (through match), but I don't get how to get ui content, for example how to replace central panel content and bottom panel panel at the same time after click on a button
I think it should be like that
enum AppState{
ConfigureSchemeChoosing,
ConfigureNaming,
struct App{
app_state: AppState,
}
fn update(&mut self, ctx: &eframe::egui::Context, frame: &mut eframe::Frame) {
egui::TopBottomPanel::bottom("footer")
.show(ctx, |ux|{
match AppState {
ConfigureSchemeChoosing => {
ui.button("next")
}
ConfigureNaming => {
ui.button("previous")
}
}
});
}
Moreover, I want elements to be in other rs files. One window = one file
}
1 post - 1 participant
🏷️ rust_feed