-
Why does the following not work when using use eframe::egui::{self, Align, Layout};
struct MyApp {}
impl MyApp {
fn new(cc: &eframe::CreationContext<'_>) -> Self {
Self {}
}
}
impl eframe::App for MyApp {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
ui.with_layout(Layout::right_to_left(Align::Min), |ui| {
ui.with_layout(Layout::top_down(Align::Min), |ui| {
ui.label("AAA");
ui.label("BBB");
ui.label("CCC");
});
ui.with_layout(Layout::top_down(Align::Min), |ui| {
ui.label("DDD");
ui.label("EEE");
ui.label("FFF");
});
});
});
}
}
fn main() {
eframe::run_native(
"My App",
eframe::NativeOptions::default(),
Box::new(|cc| Ok(Box::new(MyApp::new(cc)))),
)
.unwrap();
}
|
Beta Was this translation helpful? Give feedback.
Answered by
pozix604
Jan 3, 2025
Replies: 1 comment
-
Made it work with |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
pozix604
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Made it work with
Align::Max
. That was unintuitive.