mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 05:10:03 -04:00
Make docs set control_flow in a more realistic way (#1376)
This commit is contained in:
@@ -26,12 +26,14 @@ pub use crate::icon::*;
|
||||
/// let window = Window::new(&event_loop).unwrap();
|
||||
///
|
||||
/// event_loop.run(move |event, _, control_flow| {
|
||||
/// *control_flow = ControlFlow::Wait;
|
||||
///
|
||||
/// match event {
|
||||
/// Event::WindowEvent {
|
||||
/// event: WindowEvent::CloseRequested,
|
||||
/// ..
|
||||
/// } => *control_flow = ControlFlow::Exit,
|
||||
/// _ => *control_flow = ControlFlow::Wait,
|
||||
/// _ => (),
|
||||
/// }
|
||||
/// });
|
||||
/// ```
|
||||
|
||||
Reference in New Issue
Block a user