golang-ui / nuklear

This project provides Go bindings for nuklear.h — a small ANSI C GUI library.

Home Page:https://github.com/vurtun/nuklear

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

etc.go getters/setters

rishabh-bector opened this issue · comments

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

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.