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

@ -1,17 +1,23 @@
mod content;
mod navigation;
use content::Content;
use navigation::Navigation;
use gtk::{glib::GString, prelude::BoxExt, Box, Orientation};
pub struct Page {
widget: Box,
navigation: Navigation,
content: Content,
}
impl Page {
// Construct
pub fn new(name: GString) -> Page {
// Init components
let navigation = navigation::Navigation::new();
let content = content::Content::new();
let content = Content::new();
let navigation = Navigation::new();
// Init widget
let widget = Box::builder()
@ -23,7 +29,17 @@ impl Page {
widget.append(content.widget());
// Result
Self { widget }
Self {
widget,
content,
navigation,
}
}
// Actions
pub fn update(&self) {
self.navigation.update();
// @TODO self.content.update();
}
// Getters