Skip to content

Add new Gizmo widget helper to create custom widgets in GTK4 #293

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ARKye03
Copy link

@ARKye03 ARKye03 commented Feb 20, 2025

While gtkgizmo.c is quite simple, I need to review the code thoroughly and test it in the field (e.g. CircularProgress).

Note

CircularProgress above will be merged onto https://github.com/ARKye03/astal/tree/feat/CircularProgressWidget, to keep work at #282

@ARKye03 ARKye03 marked this pull request as ready for review February 20, 2025 19:27
@ARKye03
Copy link
Author

ARKye03 commented Feb 20, 2025

I used it to construct the CircularProgress keeping it more readable and simple, and it works. So, it's ready for review. This widget is no more than a ""copy-paste"" of the gtkgizmo, but in Vala.

@kotontrion
Copy link
Collaborator

Should AstalGizmo implement Gtk.Buildable?

No. Creating a Gizmo with a Builder is nonesense, as you can't define the functions that way.

Also using function pointers like here in gobject introspection is not that straight forward. It would involve a bit more work. I think the best cause of action would be making that class internal instead of public, so it can be used by astal, but it's not exposed in the gir.

Otherwise looks good to me, didn't test it though.

@ARKye03
Copy link
Author

ARKye03 commented Feb 20, 2025

Should AstalGizmo implement Gtk.Buildable?

No. Creating a Gizmo with a Builder is nonesense, as you can't define the functions that way.

Yes, I realized this rather quickly.

Also using function pointers like here in gobject introspection is not that straight forward. It would involve a bit more work. I think the best cause of action would be making that class internal instead of public, so it can be used by astal, but it's not exposed in the gir.

I made it internal

Now I can rest and ignore GJS bindings <3

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.

2 participants