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

Closing "Window" and title collision? #10

Closed Chillance closed 6 years ago

Chillance commented 7 years ago

Hey,

So, this is might not be this libary's problem, although, it might need some additional functions to expose more things, such as a func (p *Panel) IsClosed().

But the owner of the other repo doesn't seem all that active, so I thought I post here too as you are more active and could possible help me out.

So, what say you about this: https://github.com/vurtun/nuklear/issues/361 ?

Thanks!

xlab commented 7 years ago

Hi, no quick answer on this from me, I'm quite busy too, also don't know Nuklear so deep as you in the referenced issue. I hope vurtun or dumblob will help sooner :)

Chillance commented 7 years ago

Thanks for quick answer. After looking into it a bit more, it seems that this: if nk.NkGroupBegin(ctx, s(name), nk.WindowMovable|nk.WindowClosable|nk.WindowNoScrollbar|nk.WindowBorder|nk.WindowTitle) != 0 {...}

should actually make it so I don't enter when closing the "node" (panel), and thus not be rendered anymore, but instead I get: nuklear.h:17834: nk_panel_layout: Assertion `!(layout->flags & NK_WINDOW_HIDDEN)' failed.

I'm just not sure exactly how this is suppose to work and be handled...

xlab commented 7 years ago

Unrelated: you can omit s() helper with the lates version of Nk, strings there are safe as for now.

Chillance commented 7 years ago

Ah. Cool.

Also, I got a response in the other repo. Will test that.

Actually, how would one go on about updating here? I suppose copy it over to this Go wrapper, as it doesn't link to the other repo to get the latest?

xlab commented 7 years ago

Maximum I can do here is to bump the header version :)

I suppose copy it over to this Go wrapper, as it doesn't link to the other repo to get the latest?

No it doesn't, also the bindings are automatically generated by hand, so you or someone else needs to run Makefile to update the Go code to reflect some API changes. And run nk-example to test if everything is OK.

Updated to 1.33.0

Chillance commented 7 years ago

Hmm, isn't there a way to link the nuklear.h file so it's taken from the other repo when updating this repo? Although, not as "stable" then I suppose.

xlab commented 7 years ago

1) not stable 2) not go-gettable 3) bindings with outdated header may get broken

Chillance commented 7 years ago

Yeah, makes sense.