Well, im at it again with this project. I took quite a long break to make another project, and now have had the time to come back to this. I’ve finally written some in-depth docs, and will review them later today with a fresh mind to be sure that they’re as right as possible.
I also fixed a design flaw, but im not very sure if how i did it really fixed it. Before, this is the old way it’s doing it:
app.ui(|_, ui| {
// put stuff inside some ui levels
egui::CentralPanel::default()
.frame(egui::Frame::NONE)
.show(ui, |ui| {
// maybe make new ui levels
// inside the levels, return TryExit
TryExit::Force
})
.inner.inner.inner //as many .inner as ui levels
// TryExit is in, because you need to return the inner TryExit
})
this felt extremely clunky. So, i solved it like this:
// mutable reference to a TryExit
app.ui(|_, ui, exit: &mut TryExit| {
// as many levels as you want
egui::CentralPanel::default()
.frame(egui::Frame::NONE)
.show(ui, |ui| {
// instead of returning it, mutate the passed-in reference
*exit = TryExit::Force;
}); // no need to return anything, so no .inner
})
this feels a bit better, but idrk still. For the time being, the API will be the latter.
Anyways, have a look at the new docs: