init update action

This commit is contained in:
yggverse 2024-09-24 23:08:40 +03:00
parent 68a97fdc88
commit ae3cc7a7d5
14 changed files with 91 additions and 27 deletions

View file

@ -12,7 +12,7 @@ pub struct Main {
impl Main {
// Construct
pub fn new() -> Main {
pub fn new() -> Arc<Main> {
// Init components
let tab = Tab::new();
@ -22,7 +22,7 @@ impl Main {
widget.append(tab.widget());
// Init struct
Self { tab, widget }
Arc::new(Self { tab, widget })
}
// Actions
@ -42,6 +42,10 @@ impl Main {
self.tab.pin();
}
pub fn update(&self) {
self.tab.update();
}
// Getters
pub fn widget(&self) -> &Box {
&self.widget