vurtun/nuklear

nk_checkbox_label inside a loop and accessing it's values

LinArcX opened this issue · 3 comments

Hi. i need to generate nk_checkbox_label dynamically. So this is my code:

...
for(size_t  i=0; i<vector_size(projects); i++){
    if(nk_tree_push_id(ctx, NK_TREE_NODE, "Window", NK_MINIMIZED, i)) {
        nk_layout_row_dynamic(ctx, 25, 1);
        nk_label(ctx, "Files ready to commit:", NK_TEXT_LEFT);
        for (size_t  j = 0; j < vector_size(projects[i]); j++) {
            nk_checkbox_label(ctx, projects[i][j], &titlebar);
        }
        nk_tree_pop(ctx);
    }
}
...

How do that?
And also how can i gather all checked lables in particular Node?

I'm currently out of time, but did you look thoroughly through all the demos demo/ and examples example/?

@dumblob Yeah, but they all created manually (No for loop, no dynamic creation).

Ok. Do all the "manually created" checkboxes work for you? What does your current code actually do - what do you observe?