RobLoach / RobLoach/nuklear_console
Trying to force scroll of a page, but I'm having trouble.
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 22
- Forks
- 4
- Avg merge
- 4m
- Merged PRs (30d)
- 2
Description
In the event for one of my buttons, called UIFunc_OnConfigureBinds, which executes when I pick the configure binds button, or force it with a call to that function, I do this at the end:
nk_console_set_active_parent(configureBinds);
if (lastKeyBindWidget != 0)
{
nk_console* keyButton = inputMenuList[lastKeyBindWidget].menuItem;
nk_console_top_data* data = (nk_console_top_data*)nk_console_get_top(keyButton)->data;
nk_console_set_active_widget(keyButton);
if (data != NULL)
{
SDL_Log("Attempting to set scroll");
data->scroll_to_widget = keyButton;
data->input_processed = nk_true;
lastKeyBindWidget = 0;
}
}
But, for some reason, while it gets to "Attempting to set scroll", the scroll_to_widget doesn't work.
I need a way to force scroll a page to the widget in question, since this isn't reached via a traditional nk_console_navigate_back call.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing UIFunc_OnConfigureBinds through nk_console_set_active_parent, nk_console_set_active_widget, and the scroll_to_widget handling in nk_console_top_data. Reproduce the configure-binds path and compare it with nk_console_navigate_back, then verify that selecting a stored keyButton scrolls the page to that widget when the callback is forced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100