43 lines
729 B
Rust
43 lines
729 B
Rust
|
use gtk;
|
||
|
use std::rc::Rc;
|
||
|
use gtk::WidgetExt;
|
||
|
|
||
|
|
||
|
pub struct AppS {
|
||
|
_cant_construct: (),
|
||
|
pub gui: Gui,
|
||
|
}
|
||
|
|
||
|
|
||
|
impl AppS {
|
||
|
pub fn new() -> Self {
|
||
|
let builder = gtk::Builder::new_from_string(include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/data/ui/window.glade")));
|
||
|
|
||
|
return AppS {
|
||
|
_cant_construct: (),
|
||
|
gui: Gui::new(builder),
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
pub struct Gui {
|
||
|
_cant_construct: (),
|
||
|
pub window: gtk::Window
|
||
|
}
|
||
|
|
||
|
impl Gui {
|
||
|
pub fn new(builder: gtk::Builder) -> Self {
|
||
|
return Gui {
|
||
|
_cant_construct: (),
|
||
|
window: builder.get_object("main").unwrap(),
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
pub fn init(appstate: Rc<AppS>) {
|
||
|
appstate.gui.window.show_all();
|
||
|
}
|
||
|
|