-
Object reform introduced autogenerated high-level bindings and broke some conventions.
-
Constructors don't return
Option, they never fail. -
Companion traits renamed e.g.
ButtonTrait->ButtonExt. -
Modules are private now, all items are exported at the crate level (e.g.
gtk::button::Buttonis no longer visible, usegtk::Buttoninstead). -
Dialog APIs made less Rust-y for consistency with upstream.
-
File name types changed from
&strtoT: AsRef<Path>. -
A few signatures and spellings corrected to match upstream.
-
-
Version features reintroduced and autodetection is no more. The fallback version is 3.4.
Select the minimal version required by your application like this:
[dependencies.gtk] features = ["v3_10"]
-
Signal handlers take the receiver by reference and support more specific receiver types.
-
New safe event bindings are passed to signal handlers. These bindings have safe getters while the low-level event structs are still reachable via
as_ref. -
New safe
ErrorandValuebindings.ListStoreandTreeStorechanged accordingly, tradedset_stringfor more powerfulset. -
In an ongoing move to reflect integer unsignedness properly
Notebookswitched fromi32tou32,ListStoreandTreeStorepartly switched tou32andEntryBufferswitched tou16.
-
Object reform benefits include:
-
Automatic generation of the majority of code, expanding the number of implemented classes, eliminating typos and making maintenance easier.
-
Unified upcasting and downcasting via the
Casttrait, proper interface support. In particular this makesBuildersafe to use. -
Each crate has a
preludemodule, which reexports all traits and some ubiquitous types (Continue,Inhibit).gtk's prelude incorporatesglib's one. -
Removal of the C glue layer and gcc dependency.
-
-
The upstream documentation excised from all crates earlier lives in the
lgpl-docscrate now. It can be embedded into your local copy ofgtkand other crates by enabling theembed-lgpl-docsfeature. -
Windows users no longer need to delete Rust's bundled gcc.
-
In the absence of
pkg-configwe try to link anyway assuming the libraries can be found in the default search path. There are no version checks in this case. -
Setting
GTK_LIB_DIRskipspkg-configaltogether.
- TBD