Add button
This commit is contained in:
parent
2639eb2b2f
commit
1c8d4a1677
14
src/main.rs
14
src/main.rs
|
@ -17,5 +17,19 @@ fn build_ui(app: &Application) {
|
||||||
.title("Hello, World!")
|
.title("Hello, World!")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
let button = Button::builder()
|
||||||
|
.label("Press me!")
|
||||||
|
.margin_top(12)
|
||||||
|
.margin_bottom(12)
|
||||||
|
.margin_start(12)
|
||||||
|
.margin_end(12)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
button.connect_clicked(move |button| {
|
||||||
|
button.set_label("Hello, World!");
|
||||||
|
});
|
||||||
|
|
||||||
|
window.set_child(Some(&button));
|
||||||
|
|
||||||
window.present();
|
window.present();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue