vurtun / nuklear

A single-header ANSI C gui library
13.68k stars 1.11k forks source link

Any documentation on using nk_textedit? #857

Closed JamesTheHacker closed 5 years ago

JamesTheHacker commented 5 years ago

Are there any examples on using nk_textedit? I've looked through the header file and found you use stb text edit, but still confused on how to get it working.

So far this is what I've got:

/* GUI */
if (nk_begin(ctx, "Article", nk_rect(50, 50, 230, 250),
    NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_SCALABLE|
    NK_WINDOW_MINIMIZABLE|NK_WINDOW_TITLE))
{
    nk_layout_row_static(ctx, 30, 80, 1);
    nk_textedit_init_default(state);
    nk_textedit_text(state, "Holla", 6);
}
nk_end(ctx);

If I build and run it opens quickly and then closes. But if I replace with code from the demo's using buttons I can render those fine.

I have NK_INCLUDE_DEFAULT_ALLOCATOR defined.

Is there any documentation for these components? I'd love to help by creating some if not but I need to spend some time with nuklear first. Awesome library by the way!

Any IRC or Slack channels?

dumblob commented 5 years ago

IIRC there could be something in demo/ and example/ folders. There were also some discussions in this issue tracker, so try to read some of them.

Is there any documentation for these components? I'd love to help by creating some if not but I need to spend some time with nuklear first.

Well, there is doc/, then of course wiki (not that much maintained, but 99% of the information shall be correct as Nuklear follows Semver and because the major number is just 4 after all the years of hectic development, then we can say Nuklear is quite backwards compatible) and this issue tracker :)

Any IRC or Slack channels?

No, we're all super busy, so no time to chat and no plans to introduce an information black hole (it's difficult to follow chat as it's by definition "chatty" and it's difficult to reference any information from a chat and even more difficult to search for such information - typically for newcomers). Ask questions here in this tracker instead :wink:.

JamesTheHacker commented 5 years ago

I had tried the demo and examples and couldn't find anything that used nk_textedit. But ... I had missed the wiki :)