-
Notifications
You must be signed in to change notification settings - Fork 1
Added template helpers, examples and fix for compiler error #8
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
base: master
Are you sure you want to change the base?
Conversation
| PollFD :: _GPollFD | ||
| PollFunc :: #type proc "c" (ufds: [^]PollFD, nfsd: uint_, timeout_: int_) -> int_ | ||
| SList :: _GSList | ||
| _GSList :: struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This throws the compiler into an infinite loop.
|
I figured out the issues, this should be fine now. Added a couple of template helpers in place of the C macros and made them a bit more odin-esque. If you have a different vision about the templating API, I'm completely open to suggestions :D I also added 2 examples:
|
|
Alright, I think this is as feature complete as it's going to get. Supports (and has examples for) pretty much everything GTK templates can do. |
Why do I keep committing these :( sorry
8a4f286 to
7c196e2
Compare
Hi!
This sort of resolves #2,
except for one issue that I couldn't figure out.Template children binding currently does not work, and segfaults.I am using all the correct functions, but it just doesn't work.
Ah well. Maybe I, or someone smarter than me, can figure it out in the future!
See my 2nd comment in this issue! Everything works now! 🥳
In the meantime, I think this is a decent starting point for others to see how templates work when we have no access to the macros virtually all C examples rely on 😄
Subclassing widgets is almost identical to this as well, so I think this will be useful.
Screencast.From.2025-11-15.21-53-42.mp4
Aparte: this also includes a manual fix in
glib.odin#L368as mentioned in #7 and odin-lang/Odin#5929.Eventually, a compile fix will be merged, but in the meantime we must remove the alias, otherwise it cannot compile.
Cheers!