gtk-rs / gtk

DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!
https://gtk-rs.org/
MIT License
1.24k stars 82 forks source link

*ImplExt traits are not exported from gtk::subclass::prelude #973

Closed tsahyt closed 4 years ago

tsahyt commented 4 years ago

The *ImplExt traits are required to call parent methods. Currently this requires explicitly importing them since they're not part of the prelude (with the exception of ObjectImplExt). Calling parent methods is a common enough thing that it might be worth to consider putting them into the prelude module.

I brought this up in the Matrix room yesterday and was instructed to open an issue here.

sdroege commented 4 years ago

Yes it should be in the subclass prelude :) That wasn't noticed so far because usually people import the whole module with the subclass (e.g. use gtk::subclass::widget::*) in their code, but that shouldn't really be required.

sdroege commented 4 years ago

Do you want to provide PRs for that (here and in gio and maybe in glib)?

EPashkin commented 4 years ago

@sdroege We currently don't have "subclass prelude", better to add it to base "prelude.rs" or add new file?

sdroege commented 4 years ago

We do :) here: https://github.com/gtk-rs/gtk/blob/1e26d0ac57f3d71c5ed2c00fe913d106f0eb272a/src/subclass/mod.rs#L29

EPashkin commented 4 years ago

Thanks, updated gio's PR

tsahyt commented 4 years ago

@sdroege Sure, it only involves adding a bunch of pub use statements anyhow. So I suppose it should be added for all existing ImplExt traits then?

sdroege commented 4 years ago

@tsahyt Yeah. For gio, @EPashkin did it already here https://github.com/gtk-rs/gio/pull/284

sdroege commented 4 years ago

@EPashkin This is done now or was something forgotten?

EPashkin commented 4 years ago

As I remember all done

sdroege commented 4 years ago

@GuillaumeGomez Please close :)