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::{
|
||||
event::{Event, WindowEvent},
|
||||
event_loop::{ControlFlow, EventLoop},
|
||||
event_loop::EventLoop,
|
||||
window::WindowBuilder,
|
||||
};
|
||||
|
||||
@ -11,18 +11,26 @@ fn main() {
|
||||
let ver = option_env!("CARGO_PKG_VERSION").unwrap_or("x.x.x");
|
||||
|
||||
let event_loop = EventLoop::new();
|
||||
let window = WindowBuilder::new()
|
||||
|
||||
WindowBuilder::new()
|
||||
.with_title(format!("IPass - {ver}"))
|
||||
.build(&event_loop).expect("Expected to create window");
|
||||
|
||||
event_loop.run(move |event, _, control_flow| {
|
||||
*control_flow = ControlFlow::Wait;
|
||||
|
||||
control_flow.set_wait();
|
||||
|
||||
match event {
|
||||
Event::WindowEvent {
|
||||
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