gtk-rs / gtk

DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!

Home Page:https://gtk-rs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

tsahyt opened this issue · comments

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.

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.

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

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

We do :) here:

pub mod prelude {

Thanks, updated gio's PR

@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?

@tsahyt Yeah. For gio, @EPashkin did it already here gtk-rs/gio#284

@EPashkin This is done now or was something forgotten?

As I remember all done