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

Consider using g_type_name instead of g_base_info_get_name when possible #18

Open
vixalien opened this issue Dec 16, 2023 · 0 comments
Open

Comments

@vixalien
Copy link
Contributor

vixalien commented Dec 16, 2023

It is a better name for the .name properties (the one that gets logged in the console.) This is very helpful in debugging, particular in the early stages of the project.

The GObject.type_name produces more consistent and better names for classes and methods, unlike GI.BaseInfo.get_name, which only returns the name of the type without including the namespace info.

Another alternative would be just using namespace + name (factoring in parent types). Compare:

GObject.type_name GI.BaseInfo.get_name namespace + name
GtkWidget Widget Gtk.Widget
gtk_widget_init_template init_template Gtk.Widget.init_template
GObject Object GObject.Object
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

No branches or pull requests

1 participant