redo event fn signature & add event_ctx macro
This commit is contained in:
@@ -1,20 +1,14 @@
|
||||
use iris::{prelude::*, winit::*};
|
||||
|
||||
fn main() {
|
||||
UiApp::<State>::run();
|
||||
DefaultApp::<State>::run();
|
||||
}
|
||||
|
||||
struct State {
|
||||
ui: DefaultUi,
|
||||
}
|
||||
struct State;
|
||||
|
||||
impl DefaultUiState for State {
|
||||
fn new(mut ui: DefaultUi, _proxy: Proxy<Self::Event>) -> Self {
|
||||
rect(Color::RED).set_root(&mut ui);
|
||||
Self { ui }
|
||||
}
|
||||
|
||||
fn ui(&mut self) -> &mut DefaultUi {
|
||||
&mut self.ui
|
||||
impl DefaultAppState for State {
|
||||
fn new(ui: &mut Ui, _state: &UiState, _proxy: Proxy<Self::Event>) -> Self {
|
||||
rect(Color::RED).set_root(ui);
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user