gtk-rs / gtk-rs-core

Rust bindings for GNOME libraries
https://gtk-rs.org/gtk-rs-core
MIT License
272 stars 104 forks source link

[DISCUSSION] Automatic `ensure_type()` #1401

Closed DaKnig closed 1 month ago

DaKnig commented 1 month ago

look at this boilerplate. each type has to specify what other custom types it depends on, forming a kind of a tree that devs need to maintain. this leads to code duplication (I have this line at least 4 times), maybe we could solve this. this is also confusing to beginners and adds extra burden...

proposed ideas:

we have most of the information to do it automatically. I think it should be done.

bilelmoussaoui commented 1 month ago

It is already called automatically for types that are used in TemplateChild

DaKnig commented 1 month ago

my bad! I was able to remove all but the last one! thanks!