Skip to content

Commit fc02e9e

Browse files
Merge pull request #251 from lucab/ups/prelude-traits
Fix section on prelude re-exports
2 parents 78ebd04 + 5467f97 commit fc02e9e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

_posts/2021-06-22-new-release.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,19 @@ to be able to use them. Now, you only need to import GTK and then you can do:
8585
use gtk::{cairo, gdk};
8686
```
8787

88-
The `-sys` crates are also re-exported under the name `ffi`:
88+
And that's it! It'll make your management of dependencies much simpler. To be noted, relevant traits
89+
are also re-exported in the `prelude`, so importing it will give you access to them:
90+
91+
```rust
92+
use gtk::gdk;
93+
use gtk::prelude::*;
94+
95+
// ...
96+
// This uses the `gdk::prelude::WindowExtManual` trait, through the prelude.
97+
let w = gdk::Window::default_root_window();
98+
```
99+
100+
Last note about the re-exports: the `-sys` crates are also re-exported under the name `ffi`:
89101

90102
```rust
91103
use gtk::ffi;

0 commit comments

Comments
 (0)