Add button
This commit is contained in:
parent
54dc50edb6
commit
e13df0eb72
12
src/main.rs
12
src/main.rs
@ -1,5 +1,5 @@
|
|||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gtk::{Application, ApplicationWindow};
|
use gtk::{Application, ApplicationWindow, Button};
|
||||||
|
|
||||||
const APP_ID: &'static str = "org.gtk-rs.Gamarjoba";
|
const APP_ID: &'static str = "org.gtk-rs.Gamarjoba";
|
||||||
|
|
||||||
@ -10,9 +10,19 @@ fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn build_ui(app: &Application) {
|
fn build_ui(app: &Application) {
|
||||||
|
|
||||||
|
let button = Button::builder()
|
||||||
|
.label("Hit me!")
|
||||||
|
.margin_top(12)
|
||||||
|
.margin_bottom(12)
|
||||||
|
.margin_start(12)
|
||||||
|
.margin_end(12)
|
||||||
|
.build();
|
||||||
|
|
||||||
let window = ApplicationWindow::builder()
|
let window = ApplicationWindow::builder()
|
||||||
.application(app)
|
.application(app)
|
||||||
.title("Gamarjoba from GTK4")
|
.title("Gamarjoba from GTK4")
|
||||||
|
.child(&button)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
window.present();
|
window.present();
|
||||||
|
Loading…
Reference in New Issue
Block a user