Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New and with_type methods as in gtk-rs-core #1384

Open
ranfdev opened this issue Apr 27, 2023 · 3 comments · May be fixed by #1415
Open

New and with_type methods as in gtk-rs-core #1384

ranfdev opened this issue Apr 27, 2023 · 3 comments · May be fixed by #1415
Labels
enhancement New feature or request
Milestone

Comments

@ranfdev
Copy link
Member

ranfdev commented Apr 27, 2023

In general, we should provide typed methods when possible and with_type variants.

Example: Widget::ancestor(widget, type) (which currently returns a Option<Widget>) could become Widget::ancestor::<gtk::Label>(widget) and directly return a typed Option<Label>.

@ranfdev ranfdev added the enhancement New feature or request label Apr 27, 2023
@bilelmoussaoui
Copy link
Member

Would be nice to gather a list of methods that could make use of such changes.

@jf2048
Copy link
Member

jf2048 commented Apr 28, 2023

I counted these:

gdk4::ContentFormats::for_type
gdk4::ContentFormats::contains_type
gdk4::ContentFormatsBuilder::add_type
gdk4::ContentProviderExtManual::value
gtk4::DropTarget::new
gtk4::WidgetExt::ancestor

@bilelmoussaoui
Copy link
Member

@bilelmoussaoui bilelmoussaoui added this to the 0.7.0 milestone Jul 6, 2023
bilelmoussaoui added a commit that referenced this issue Jul 6, 2023
@bilelmoussaoui bilelmoussaoui linked a pull request Jul 6, 2023 that will close this issue
bilelmoussaoui added a commit that referenced this issue Jul 6, 2023
@bilelmoussaoui bilelmoussaoui modified the milestones: 0.7.0, 0.8.0 Aug 3, 2023
@bilelmoussaoui bilelmoussaoui modified the milestones: 0.8.0, 0.9.0 May 31, 2024
@sdroege sdroege modified the milestones: 0.9.0, 0.10 Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
4 participants