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

Accessor Functions for C structs #61

Merged
merged 3 commits into from Dec 28, 2018
Merged

Accessor Functions for C structs #61

merged 3 commits into from Dec 28, 2018

Conversation

gmp216
Copy link
Contributor

@gmp216 gmp216 commented Nov 15, 2018

This is a rough sketch of an enhancement that creates cgo_helpers for structs. For each field in each C struct, a cgo-helper is created to return the field for that struct. Using the nuklear example, you will be able to set style flags as follows:

*ctx.Style().GetButton().GetTextAlignment() = nk.TextAlignLeft | nk.TextAlignMiddle

It compiles and works for this simple example with nuklear. Otherwise not extensively tested, so there are probably cases where it does the wrong thing.

@gmp216
Copy link
Contributor Author

gmp216 commented Dec 19, 2018

bump

@xlab
Copy link
Owner

xlab commented Dec 19, 2018

@gmp216 sorry, was out of time for the latest months. I would like to move such functionality to YAML as additional options, for example, to enable this feature as we have "safe strings" — only for projects that need it.

@gmp216
Copy link
Contributor Author

gmp216 commented Dec 28, 2018

Makes sense. See 70a32bb.

@xlab
Copy link
Owner

xlab commented Dec 28, 2018

@gmp216 nice, thank you

@xlab xlab merged commit c220fac into xlab:master Dec 28, 2018
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.

None yet

2 participants