Rust code example on the homepage is broken
The Rust code example on https://www.gtk.org/ is broken. I get the following error message
error[E0599]: no function or associated item named `new_with_label` found for struct `gtk::Button` in the current scope
--> src/main.rs:10:31
|
10 | let button = gtk::Button::new_with_label("Hello World!");
| ^^^^^^^^^^^^^^
| |
| function or associated item not found in `gtk::Button`
| help: there is an associated function with a similar name: `with_label`
error[E0599]: no method named `set_child` found for struct `ApplicationWindow` in the current scope
--> src/main.rs:13:12
|
13 | window.set_child(&button);
| ^^^^^^^^^ method not found in `ApplicationWindow`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0599`.
error: could not compile `gtk-test`
The function Button::new_with_label()
should probably be replaced by Button::with_label()
, and window.set_child()
by window.add_child()
. However I'm completely new to GTK and have no clue how to make add_child
work, which expects some kind of builder?