implement separated mod for window widget, rename getters

This commit is contained in:
yggverse 2024-10-06 05:03:45 +03:00
parent 13292a977d
commit 1e00c5930c
5 changed files with 58 additions and 64 deletions

View file

@ -0,0 +1,20 @@
use gtk::{prelude::BoxExt, Box, Notebook, Orientation};
pub struct Widget {
gobject: Box,
}
impl Widget {
// Construct
pub fn new(tab: &Notebook) -> Self {
let gobject = Box::builder().orientation(Orientation::Vertical).build();
gobject.append(tab);
Self { gobject }
}
// Getters
pub fn gobject(&self) -> &Box {
&self.gobject
}
}