mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 13:20:06 -04:00
Make examples set control_flow in a more realistic way (#1363)
* Make examples set control_flow in a more realistic way * Format
This commit is contained in:
@@ -16,6 +16,7 @@ fn main() {
|
||||
window.set_title("A fantastic window!");
|
||||
|
||||
event_loop.run(move |event, _, control_flow| {
|
||||
*control_flow = ControlFlow::Wait;
|
||||
println!("{:?}", event);
|
||||
|
||||
match event {
|
||||
@@ -23,7 +24,7 @@ fn main() {
|
||||
event: WindowEvent::CloseRequested,
|
||||
..
|
||||
} => *control_flow = ControlFlow::Exit,
|
||||
_ => *control_flow = ControlFlow::Wait,
|
||||
_ => (),
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user