Skip to content
GTK 4 bindings and wrappers for Rust (Development)
Rust
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gir @ 8335272
gir-files @ 22748fa
resources
src
tests
.gitignore
.gitmodules
.travis.yml
COPYRIGHT
Cargo.toml
Gir.toml
LGPL
LICENSE
Makefile
README.md
build.rs
check_init_asserts
release_process.md
rust_setup.png

README.md

gtk4 Build Status

Project site | Online documentation

Rust bindings and wrappers for GTK 4.

Building

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

Using

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

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

[dependencies]
gtk = { git = "https://github.com/gtk-rs/gtk4.git" }

Avoid mixing versioned and git crates like this:

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

Documentation

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

Contribute

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.

License

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

You can’t perform that action at this time.