20 releases

0.8.1 Feb 7, 2020
0.8.0 Dec 14, 2019
0.7.1 Jul 4, 2019
0.6.0 Feb 21, 2019
0.0.3 Jul 18, 2015

#2 in GUI

Download history 1904/week @ 2019-12-17 1743/week @ 2019-12-24 1907/week @ 2019-12-31 2432/week @ 2020-01-07 1998/week @ 2020-01-14 1996/week @ 2020-01-21 2742/week @ 2020-01-28 2928/week @ 2020-02-04 3368/week @ 2020-02-11 3060/week @ 2020-02-18 2989/week @ 2020-02-25 3110/week @ 2020-03-03 4245/week @ 2020-03-10 4418/week @ 2020-03-17 3086/week @ 2020-03-24 2077/week @ 2020-03-31

8,950 downloads per month
Used in 98 crates (87 directly)

MIT and maybe LGPL-2.0

142K SLoC

gtk Build Status Build status Gitter

Project site | Online documentation

Rust bindings and wrappers for GLib, GDK 3, GTK+ 3 and Cairo.


gtk expects GTK+, GLib and Cairo development files to be installed on your system. See the requirements page.


We recommend using crates from crates.io, as demonstrated here.

If you want to track the bleeding edge, use the git dependency instead:

gtk = { git = "https://github.com/gtk-rs/gtk.git" }

Avoid mixing versioned and git crates like this:

# This will not compile
gdk = "0.2"
gtk = { git = "https://github.com/gtk-rs/gtk.git" }


The majority of the documentation is kept in a separate repo due to licensing issues. You can pull it in with cargo:

> cargo build --features embed-lgpl-docs

Changes to those doc-comments should be submitted to the lgpl-docs repo. Avoid including those embedded doc-comments in PRs to this repo.

The opposite feature removes all of those docs regardless of edits:

> cargo build --features purge-lgpl-docs

These features rewrite the crate sources so it's sufficient to enable them once. Omitting them in the following cargo invocations will not undo their effects!

Generate the docs:

> cargo doc --features v3_16

(if the installed GTK+ version is lower than 3.16, adjust the feature name accordingly).


Contributor you're welcome!

See the general bindings documentation.

Most of the bindings (src/auto) are generated by gir using this configuration file. After editing Gir.toml the sources can be regenerated with

> make gir

When opening a PR please put the changes to the src/auto directory in a separate commit.


gtk is available under the MIT License, please refer to it.


~163K SLoC