gxi_desktop_binds 0.1.4

desktop bindings for the gxi-rs project
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{create_widget, impl_widget};

create_widget!(Button);

impl Node for Button {
    impl_widget!(Button);
}

impl Button {
    pub fn label(&self, label: &str) {
        self.widget.set_label(label);
    }

    pub fn on_click<F: Fn() + 'static>(&self, f: F) {
        self.widget.connect_clicked(move |_| f());
    }
}