Add methods to set ControlFlow operation
This allows downstream users to avoid importing `ControlFlow` from winit.
This commit is contained in:
parent
c57294b41a
commit
d624a3e648
27 changed files with 120 additions and 86 deletions
|
|
@ -18,7 +18,7 @@ pub use crate::icon::{BadIcon, Icon};
|
|||
/// ```no_run
|
||||
/// use winit::{
|
||||
/// event::{Event, WindowEvent},
|
||||
/// event_loop::{ControlFlow, EventLoop},
|
||||
/// event_loop::EventLoop,
|
||||
/// window::Window,
|
||||
/// };
|
||||
///
|
||||
|
|
@ -26,13 +26,13 @@ pub use crate::icon::{BadIcon, Icon};
|
|||
/// let window = Window::new(&event_loop).unwrap();
|
||||
///
|
||||
/// event_loop.run(move |event, _, control_flow| {
|
||||
/// *control_flow = ControlFlow::Wait;
|
||||
/// control_flow.set_wait();
|
||||
///
|
||||
/// match event {
|
||||
/// Event::WindowEvent {
|
||||
/// event: WindowEvent::CloseRequested,
|
||||
/// ..
|
||||
/// } => *control_flow = ControlFlow::Exit,
|
||||
/// } => control_flow.set_exit(),
|
||||
/// _ => (),
|
||||
/// }
|
||||
/// });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue