Skip to content

Commit

Permalink
Even simpler version
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofer-Julian committed Aug 16, 2023
1 parent 1d353b8 commit 47ed1d3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions book/src/g_object_memory_management.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,17 @@ fn build_ui(application: &Application) {
// When a button is clicked, `number` should be changed
button_increase.connect_clicked(|_| number += 1);

// Add buttons to `gtk_box`
let gtk_box = gtk::Box::builder()
.orientation(Orientation::Vertical)
.build();
gtk_box.append(&button_increase);

// Create a window
let window = ApplicationWindow::builder()
.application(application)
.title("My GTK App")
.child(&gtk_box)
.child(&button_increase)
.build();

// Present the window
window.present();
}

```

Here we would like to create a simple app with two buttons.
Expand Down

0 comments on commit 47ed1d3

Please sign in to comment.