Crate gladis[−][src]
Expand description
Easily import Glade-generated UI files into Rust code.
use gtk::prelude::*;
use gladis::Gladis;
const GLADE_SRC: &str = r#"
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.2 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkApplicationWindow" id="window">
<property name="can_focus">False</property>
<child type="titlebar">
<placeholder/>
</child>
<child>
<object class="GtkLabel" id="label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">label</property>
</object>
</child>
</object>
</interface>"#;
#[derive(Gladis, Clone)]
pub struct Window {
pub window: gtk::ApplicationWindow,
pub label: gtk::Label,
}
gtk::init().unwrap();
let _ui = Window::from_string(GLADE_SRC).unwrap();
Structs
Enums
Traits
A trait to load a struct from a builder.