golang-ui / nuklear

This project provides Go bindings for nuklear.h — a small ANSI C GUI library.
https://github.com/vurtun/nuklear
MIT License
1.57k stars 98 forks source link

etc.go getters/setters #75

Open rishabh-bector opened 5 years ago

rishabh-bector commented 5 years ago

Hi,

I'm attempting to use this library to create a UI for the game engine I'm developing here: https://github.com/rishabh-bector/rapidengine. I've read the previous issues on styling and editing the Context of Nuklear, and I understand that cgogen is not able to auto generate Getters and Setters for structs, so they have to be written by hand at the moment as you have done in etc.go. I also read that you have chosen not to export the fields of these structs, due to the large amount of internal state they contain.

In this case, is it possible for me to use cgogen to create my own bindings for Nuklear in which all struct fields are exported? I think that this would be a much more convenient solution (despite the downsides).

Thanks, Rishabh

xlab commented 5 years ago

Hi, I think you can use the latest feature introduced here:

So basically you can fork my bindings, modify manifest to have StructAccessors: true and try it. If it will work good, I think I could merge that back. :)

I think @gmp216 already does that well.