Skip to content
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.

nk_checkbox_label inside a loop and accessing it's values #889

Open
LinArcX opened this issue Aug 20, 2019 · 3 comments
Open

nk_checkbox_label inside a loop and accessing it's values #889

LinArcX opened this issue Aug 20, 2019 · 3 comments

Comments

@LinArcX
Copy link

LinArcX commented Aug 20, 2019

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?

@dumblob
Copy link
Contributor

dumblob commented Aug 20, 2019

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

@LinArcX
Copy link
Author

LinArcX commented Aug 20, 2019

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

@dumblob
Copy link
Contributor

dumblob commented Aug 20, 2019

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants