1
This commit is contained in:
parent
b57440efdd
commit
ebd346ff4a
@ -1,5 +1,14 @@
|
|||||||
pub struct UserApp {
|
use std::rc::{Rc, Weak};
|
||||||
|
use std::cell::RefCell;
|
||||||
|
use r9_macro::SharedFromSelf;
|
||||||
|
use r9_macro_derive::SharedFromSelf;
|
||||||
|
//use r9_macro::Singleton;
|
||||||
|
use r9_macro_derive::Singleton;
|
||||||
|
|
||||||
|
#[derive(SharedFromSelf)]
|
||||||
|
#[derive(Singleton)]
|
||||||
|
pub struct UserApp {
|
||||||
|
_self_wp: Weak::<RefCell::<Self>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl f9::app::UserApp for UserApp {
|
impl f9::app::UserApp for UserApp {
|
||||||
@ -21,3 +30,14 @@ impl f9::app::UserApp for UserApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl UserApp {
|
||||||
|
|
||||||
|
pub fn new() -> Self {
|
||||||
|
let p = UserApp{
|
||||||
|
_self_wp: Default::default(),
|
||||||
|
};
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
use std::rc::Rc;
|
|
||||||
use std::cell::RefCell;
|
|
||||||
use f9::app::App;
|
use f9::app::App;
|
||||||
|
|
||||||
pub mod app;
|
pub mod app;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
App::instance().borrow_mut().init(
|
App::instance().borrow_mut().init(
|
||||||
Rc::new(RefCell::new(
|
crate::app::app::UserApp::instance()
|
||||||
crate::app::app::UserApp{}))
|
|
||||||
);
|
);
|
||||||
App::instance().borrow_mut().run();
|
App::instance().borrow_mut().run();
|
||||||
App::instance().borrow_mut().uninit();
|
App::instance().borrow_mut().uninit();
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
pub mod app;
|
|
||||||
asjfklsd
|
|
2
third_party/r9
vendored
2
third_party/r9
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 07d53fe46e2580b2d9413e00404f10bdd755efb5
|
Subproject commit c22ee46299d1030ff745d604100d5067c769e510
|
Loading…
x
Reference in New Issue
Block a user