add todo
This commit is contained in:
parent
3342501c3b
commit
a462e83394
18
src/main.rs
18
src/main.rs
@ -1,6 +1,6 @@
|
|||||||
use winit::{
|
use winit::{
|
||||||
event::{Event, WindowEvent},
|
event::{Event, WindowEvent},
|
||||||
event_loop::{ControlFlow, EventLoop},
|
event_loop::EventLoop,
|
||||||
window::WindowBuilder,
|
window::WindowBuilder,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -11,18 +11,26 @@ fn main() {
|
|||||||
let ver = option_env!("CARGO_PKG_VERSION").unwrap_or("x.x.x");
|
let ver = option_env!("CARGO_PKG_VERSION").unwrap_or("x.x.x");
|
||||||
|
|
||||||
let event_loop = EventLoop::new();
|
let event_loop = EventLoop::new();
|
||||||
let window = WindowBuilder::new()
|
|
||||||
|
WindowBuilder::new()
|
||||||
.with_title(format!("IPass - {ver}"))
|
.with_title(format!("IPass - {ver}"))
|
||||||
.build(&event_loop).expect("Expected to create window");
|
.build(&event_loop).expect("Expected to create window");
|
||||||
|
|
||||||
event_loop.run(move |event, _, control_flow| {
|
event_loop.run(move |event, _, control_flow| {
|
||||||
*control_flow = ControlFlow::Wait;
|
|
||||||
|
control_flow.set_wait();
|
||||||
|
|
||||||
match event {
|
match event {
|
||||||
Event::WindowEvent {
|
Event::WindowEvent {
|
||||||
event: WindowEvent::CloseRequested,
|
event: WindowEvent::CloseRequested,
|
||||||
window_id,
|
..
|
||||||
} if window_id == window.id() => *control_flow = ControlFlow::Exit,
|
} => {
|
||||||
|
println!("The close button was pressed; stopping");
|
||||||
|
control_flow.set_exit();
|
||||||
|
},
|
||||||
|
Event::RedrawRequested(_) => {
|
||||||
|
//TODO: redraw application
|
||||||
|
},
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user