nuklear
nuklear copied to clipboard
[feature request]Is it possible to add a shape for focused widget?
I'm looking for a way to walk through all widgets by TAB and Shift+TAB, Is it possible? If yes, How can I add a frame or something to show to focused widget?
Hello, Have you solved it, I'm looking for a same way in windows too.
Take one of the demos, modify it to react to your chosen key shortcuts and act on the shortcut e.g. by traversing the tree of all objects widgets and changing their background color. This everything shall be pretty straightforward, so there is not much more to explain. Unfortunately we don't have the time to code for someone at the time being :cry:.
Hello, Thank you for the reply, now I just figure out how to switch edit focus with the tab key, just by modify the ctx->current->edit name, as the code below. but I still blind to how make the other widget like button/combobox to get focus like in the win32 application and how to transversing the tree of all objects, best wishes. ` if( nk_input_is_key_pressed(&ctx->input, NK_KEY_TAB) ) { printf("NK_KEY_TAB is clicked"); do { if(!ctx->current) { break; }
if(ctx->current->edit.active==nk_false)
{
break;
}
ctx->current->edit.name += 1;
if(ctx->current->edit.name < 0)
{
ctx->current->edit.name;
}
if(ctx->current->edit.name >= ctx->current->edit.seq -1 )
{
ctx->current->edit.name = ctx->current->edit.seq -1;
}
} while(false);
}
`
but I still blind to how make the other widget like button/combobox to get focus like in the win32 application and how to transversing the tree of all objects, best wishes.
Just read the source code of nuklear.h
and you'll find everything there. You can even first get an overview from the auto generated documentation under doc/
.
OK, thank you. when i finish i will post a update here.