gtk-rs / gtk4-rs

Rust bindings of GTK 4
https://gtk-rs.org/gtk4-rs/
MIT License
1.75k stars 168 forks source link

book: Explain final types #957

Open Hofer-Julian opened 2 years ago

Hofer-Julian commented 2 years ago

People are currently surprised that they can't subclass certain types.

bilelmoussaoui commented 2 years ago

I would avoid the usage of adw::Bin because it sets the layout manager as BinLayout and you will have to unset that in order to have a custom measure vfunc for your widget. Widget should be good enough

Hofer-Julian commented 2 years ago

I would avoid the usage of adw::Bin

I've been seeing adw::Bin often when people wanted to use a certain final type with a composite template. Seems like in that case they just wrapped it in a adw::Bin. Do you mind that use case as well?

bilelmoussaoui commented 2 years ago

I would not recommend that at least for now. People should learn to unparent their widgets on dispose and the book is the perfect place for that