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

nkEditString return flags error #74

Closed alexniver closed 5 years ago

alexniver commented 5 years ago
active := nk.NkEditString(ctx, nk.EditField|nk.EditSigEnter, textBuf, &textBufLen, textMaxLen, nk.NkFilterDefault)

according to vurtun/nuklear's example

active = nk_edit_string(ctx, NK_EDIT_FIELD|NK_EDIT_SIG_ENTER, text[7], &text_len[7], 64,  nk_filter_ascii);
                if (nk_button_label(ctx, "Submit") ||
                    (active & NK_EDIT_COMMITED))
                {
                    text[7][text_len[7]] = '\n';
                    text_len[7]++;
                    memcpy(&box_buffer[box_len], &text[7], (nk_size)text_len[7]);
                    box_len += text_len[7];
                    text_len[7] = 0;
                }

active should be 1 when enter pressed. but in my test, active is 17 when enter pressed. active is 1 by default.

alexniver commented 5 years ago

sorry my bad, NK_EDIT_COMMITED is 16, active be 16 has no problem