window/
window.rs

1use concoct::{Context, Object};
2use viewbuilder::{event_loop::WindowEvent, EventLoop, Window};
3
4struct App;
5
6impl App {
7    pub fn event(_cx: &mut Context<Self>, event: WindowEvent) {
8        dbg!(event);
9    }
10}
11
12impl Object for App {}
13
14fn main() {
15    let event_loop = EventLoop::<()>::create();
16
17    let window = Window::create();
18    Window::insert(&mut window.cx(), &event_loop);
19
20    let app = App.start();
21    window.bind(&app, App::event);
22
23    EventLoop::run(event_loop);
24}