RobLoach / RobLoach/nuklear_console

Trying to force scroll of a page, but I'm having trouble.

Open
#170 10 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.