This commit is contained in:
azw 2023-10-29 10:14:40 +00:00
parent b57440efdd
commit ebd346ff4a
4 changed files with 23 additions and 8 deletions

View File

@ -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 {
@ -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;
}
}

View File

@ -1,13 +1,10 @@
use std::rc::Rc;
use std::cell::RefCell;
use f9::app::App;
pub mod app;
fn main() {
App::instance().borrow_mut().init(
Rc::new(RefCell::new(
crate::app::app::UserApp{}))
crate::app::app::UserApp::instance()
);
App::instance().borrow_mut().run();
App::instance().borrow_mut().uninit();

View File

@ -1,2 +0,0 @@
pub mod app;
asjfklsd

2
third_party/r9 vendored

@ -1 +1 @@
Subproject commit 07d53fe46e2580b2d9413e00404f10bdd755efb5
Subproject commit c22ee46299d1030ff745d604100d5067c769e510