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

add basic subclassing functionality for treeview #975

Closed vhdirk closed 4 years ago

vhdirk commented 4 years ago

This adds the possibility to subclass TreeView. It does not, however, enable overriding subclasses since:

  1. I can't figure out which ones I would need to implement. The generated bindings seem very illogical in that respect.
  2. Most of what these methods do can still be done by connecting to signals.

Would it make sense to provide 'stub' subclassing Impls for all other widgets as well?

sdroege commented 4 years ago
1. I can't figure out which ones I would need to implement. The generated bindings seem very illogical in that respect.

What do you mean with the generated bindings being illogical?

Would it make sense to provide 'stub' subclassing Impls for all other widgets as well?

Yes, over time we should start adding the missing vfuncs though.

@GuillaumeGomez Good to be merged once the CI is happy :)

GuillaumeGomez commented 4 years ago
error[E0599]: no method named `parent_startup` found for reference `&SimpleApplicationPrivate` in the current scope
   --> src\bin\basic_subclass.rs:187:14
    |
187 |         self.parent_startup(app);
    |              ^^^^^^^^^^^^^^ method not found in `&SimpleApplicationPrivate`
    |
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
15  | use gio::subclass::application::ApplicationImplExt;
    |
error: aborting due to previous error
EPashkin commented 4 years ago

It must be fixed by gtk-rs/gio#284, I restarted CI

sdroege commented 4 years ago

@GuillaumeGomez good to be merged, only the macos timeout failure as usual.

GuillaumeGomez commented 4 years ago

I'll need to investigate this very annoying failure at some point...

EPashkin commented 4 years ago

@GuillaumeGomez It just too long, IMHO we need to minimize number of examples for CI, at minimum for macos.

GuillaumeGomez commented 4 years ago

Maybe, to be investigated...