gtk-rs / gtk3-rs

Rust bindings for GTK 3
https://gtk-rs.org
MIT License
508 stars 90 forks source link

gtk/builder: manually implement several methods (custom return codes) #691

Closed lucab closed 2 years ago

lucab commented 2 years ago

This adds a manual implementation for all the GtkBuilder methods that are using unconventional (non gboolean) return codes.

Closes: https://github.com/gtk-rs/gtk3-rs/issues/690

lucab commented 2 years ago

@GuillaumeGomez thanks for the very-very-quick feedback!

sdroege commented 2 years ago

Why? You want to change the gir code to only work with bools? Looks good to me in that case :)

lucab commented 2 years ago

@sdroege yes, in the longer term, possibly. Not an urgent need as I don't think there is anything broken right now. But I think the review comments were right, and being stricter on booleans will help ensuring we aren't unknowingly stepping on other strange cases (e.g. FDs as return codes).

sdroege commented 2 years ago

Once this is merged this can be made more strict in gir or are the more things that need to be fixed first? I'd prefer to have this merged only together with the corresponding gir change.

lucab commented 2 years ago

I don't have those insights right now, as I haven't yet cooked the gir change. But I'm ok in leaving this pending a bit longer until then.

lucab commented 2 years ago

gir patch at https://github.com/gtk-rs/gir/pull/1287. Bump PRs for the usual suspects (gtk-rs-core, gtk3, gtk4, gstreamer) are all green. So yes I think this is the only manual adjustment needed.