mirror of
https://github.com/danbulant/cushy
synced 2026-05-19 04:08:38 +00:00
15 lines
355 B
Rust
15 lines
355 B
Rust
use cushy::{
|
|
value::{Dynamic, Source},
|
|
widget::MakeWidget,
|
|
Run,
|
|
};
|
|
|
|
fn main() -> cushy::Result {
|
|
let has_unsaved_changes = Dynamic::new(true);
|
|
|
|
"Prevent Closing"
|
|
.into_checkbox(has_unsaved_changes.clone())
|
|
.into_window()
|
|
.on_close_requested(move |()| !has_unsaved_changes.get())
|
|
.run()
|
|
}
|