Skip to content

Commit d63ab6f

Browse files
Merge pull request #113 from wezm/fix-example
Fix syntax error and update example on homepage
2 parents a1e2740 + caadd33 commit d63ab6f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

index.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,29 @@ layout: wide
3737

3838
Prepare your system: [Requirements](http://gtk-rs.org/docs-src/requirements.html)
3939

40-
Include `gtk` in your `Cargo.toml` and set the minimal GTK version required by your project:
40+
Include `gtk` and `gio` in your `Cargo.toml` and set the minimal GTK version required by your project:
4141
{% assign gtk = site.data.crates | where: "name", "gtk" %}
4242

4343
~~~toml
4444
[dependencies.gtk]
4545
version = "{{ gtk[0].max_version }}"
4646
features = ["v3_16"]
47+
48+
[dependencies.gio]
49+
version = "{{ gio[0].max_version }}"
50+
features = ["v2_44"]
4751
~~~
4852

4953
__The APIs aren't stable yet. Watch the Announcements box above for breaking changes to the crates!__
5054

51-
Import the `gtk` crate and its traits:
55+
Import the `gtk` and `gio` crates and their traits:
5256

5357
~~~rust
5458
extern crate gtk;
59+
extern crate gio;
5560

5661
use gtk::prelude::*;
62+
use gio::prelude::*;
5763
~~~
5864

5965
Create an application, etc.
@@ -62,11 +68,11 @@ Create an application, etc.
6268
use gtk::{Application, ApplicationWindow, Button};
6369

6470
fn main() {
65-
let application = Application::new("com.github.gtk-rs.examples.basic", Default::default()))
71+
let application = Application::new("com.github.gtk-rs.examples.basic", Default::default())
6672
.expect("failed to initialize GTK application");
6773

6874
application.connect_activate(|app| {
69-
let window = ApplicationWindow::new();
75+
let window = ApplicationWindow::new(app);
7076
window.set_title("First GTK+ Program");
7177
window.set_default_size(350, 70);
7278

0 commit comments

Comments
 (0)