Skip to content

Commit 55faa6f

Browse files
committed
Even simpler version
1 parent dd2b1d2 commit 55faa6f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

book/src/g_object_memory_management.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,17 @@ fn build_ui(application: &Application) {
3737
// When a button is clicked, `number` should be changed
3838
button_increase.connect_clicked(|_| number += 1);
3939

40-
// Add buttons to `gtk_box`
41-
let gtk_box = gtk::Box::builder()
42-
.orientation(Orientation::Vertical)
43-
.build();
44-
gtk_box.append(&button_increase);
45-
4640
// Create a window
4741
let window = ApplicationWindow::builder()
4842
.application(application)
4943
.title("My GTK App")
50-
.child(&gtk_box)
44+
.child(&button_increase)
5145
.build();
5246

5347
// Present the window
5448
window.present();
5549
}
50+
5651
```
5752

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

0 commit comments

Comments
 (0)