How to stop Buttons from closing a dialog in Cursive?

32 Views Asked by At

I've creating a complex dialog in Cursive.

Dialog::around(
    LinearLayout::vertical()
    .child(DummyView.fixed_height(1))
    ...20 more child Views...
    .child(Button::new("Default", |_| ()))
    .child(Button::new("Wipe", |_| ()))
)
.title("Configuration")
.button("Save", save)
.button("Cancel", | s | s.quit())
.h_align(HAlign::Center)

When I click the Save or Cancel buttons, the appropriate code runs and the program exits.

When I click the Default and Wipe buttons, the Dialog closes leaving me at a screen full of my env_logger messages. (The program has not exited.)

How can I stop these buttons frmo closing the Dialog?

0

There are 0 best solutions below