create separated widget mod implementation

This commit is contained in:
yggverse 2024-09-22 18:50:47 +03:00
parent 8fa56ebf9a
commit 6f3ad01c35
3 changed files with 45 additions and 25 deletions

View file

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