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

gtk: Cleanup template related functions #1212

Merged
merged 5 commits into from
Dec 9, 2022

Conversation

bilelmoussaoui
Copy link
Member

Fixes #1189

Composite template macro uses gtk_widget_class_bind_template_child_full instead
It is not useful for us, so better avoid a mis-usage of it.
and rename it to CompositeTemplateInitializingExt to make it clear
it is limited to CompositeTemplate use cases
By moving it to CompositeTemplateExt where it makes more sense and
allows
us to drop the glib::Type parameter
Not useful for us as you can acess the struct fields that are wrapped with TemplateChild<T>
@bilelmoussaoui bilelmoussaoui merged commit 2462c0c into master Dec 9, 2022
@bilelmoussaoui bilelmoussaoui deleted the bilelmoussaoui/composite-template branch December 9, 2022 11:03
@sdroege
Copy link
Member

sdroege commented Dec 9, 2022

That's of course not backwards compatible so don't backport that :)

@bilelmoussaoui
Copy link
Member Author

That's of course not backwards compatible so don't backport that :)

yes, that is why i didn't add the corresponding label

@@ -372,10 +372,6 @@ pub trait WidgetExt: 'static {
#[doc(alias = "get_style_context")]
fn style_context(&self) -> StyleContext;

#[doc(alias = "gtk_widget_get_template_child")]
#[doc(alias = "get_template_child")]
fn template_child(&self, widget_type: glib::types::Type, name: &str) -> glib::Object;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't hurt to have it, does it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no point in having it, you can retrieve child widgets with #[template_child]. This is probably a helper for languages like Python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve bindings for gtk::Widget::dispose_template
2 participants