Closed mtilda closed 3 weeks ago
I noticed this example runs as expected even without .upcast::<gtk::Widget>()
.upcast::<gtk::Widget>()
I have a limited understanding of the language and libraries. I welcome pedantic feedback.
What I understand is that
SqueezerBin.set_child()
Option<>k::Widget>
gtk::Label
gtk::Widget
Try it yourself
cd
examples
cargo run --bin squeezer_bin
@bilelmoussaoui any thoughts on this? Have you found time to test the change?
I noticed this example runs as expected even without
.upcast::<gtk::Widget>()
I have a limited understanding of the language and libraries. I welcome pedantic feedback.
What I understand is that
SqueezerBin.set_child()
expects an argument of typeOption<>k::Widget>
https://github.com/gtk-rs/gtk4-rs/blob/53407150ab1f46494c767614783b06958a418613/examples/squeezer_bin/squeezer_bin/imp.rs#L26gtk::Label
extendsgtk::Widget
, so I believe the type constraint is already satisfied https://github.com/gtk-rs/gtk4-rs/blob/53407150ab1f46494c767614783b06958a418613/gtk4/src/auto/label.rs#L36Try it yourself
cd
in theexamples
directorycargo run --bin squeezer_bin