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

Main menu items do not appear

andydotxyz opened this issue · comments

I have converted some example code from nuklear (C) to nk and I cannot figure out why the menu does not display.

The Menu bar appears, and is clickable. But when it toggles on there is nothing visible on screen...

	nk.NkMenubarBegin(ctx)
	nk.NkLayoutRowBegin(ctx, nk.LayoutStaticRow, 25, 1)
	nk.NkLayoutRowPush(ctx, 45)
	if nk.NkMenuBeginLabel(ctx, "File", nk.TextAlignLeft, nk.NkVec2(120, 200)) > 0 {
		nk.NkLayoutRowDynamic(ctx, 25, 1)
		if nk.NkMenuItemLabel(ctx, "Quit", nk.TextAlignLeft) > 0 {
			win.SetShouldClose(true)
		}

		nk.NkMenuEnd(ctx)
	}
	nk.NkMenubarEnd(ctx)

Hi! I took the example from
https://github.com/golang-ui/nuklear/tree/master/cmd/nk-example

and pasted this menu block (after NkBegin):
https://gist.github.com/xlab/bf17492dd89abb08c32a9348e6b3c5a6#file-main-go-L97-L107

It works just fine
screen shot 2018-11-26 at 03 25 13

Please try to fill the menu before adding any rows.

Apologies, I found that the cause was that the maxElementBuffer was not enough for the application (changing 1024 to 128 * 1024 fixed it)