Immediate-Mode-UI / Immediate-Mode-UI/Nuklear

NK_EDIT_READ_ONLY when passed to nk_edit_buffer() flags disables scrollbar?

Open
#104 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
11.4k
Forks
686
Avg merge
4d 1h
Merged PRs (30d)
3

Description

I'm logging to a _nk_text_edit_ struct using the paste function. Then when rendering I do it using _nk_edit_buffer()_ and pass flag _NK_EDIT_READ_ONLY_ but it disables the scrollbar and ability to select/copy etc...

```c
static void DebugLog(const char *fmt, ...)
{
char buffer[1024] = {0};
va_list args;
va_start(args, fmt);

vsprintf(buffer, fmt, args);

mtx_lock(&debugLogger.mutex);
debugLogger.edit.mode = NK_TEXT_EDIT_MODE_INSERT;
nk_textedit_paste(&debugLogger.edit, buffer, strlen(buffer));
mtx_unlock(&debugLogger.mutex);

vfprintf(stdout, fmt, args);

va_end(args);
}
```

```c
debugLogger.edit.mode = NK_TEXT_EDIT_MODE_VIEW;
nk_edit_buffer(ctx, NK_EDIT_READ_ONLY | NK_EDIT_ALLOW_TAB | NK_EDIT_MULTILINE, &debugLogger.edit, nk_filter_ascii);

```
Is that the intended behavior? If so then how can I go about changing it to do what I want?
Or is there a different kind of widget which would work for this?

Contributor guide

Open the contributing guide

Research direction

Start at nk_edit_buffer() and the NK_EDIT_READ_ONLY flag handling, then trace how it affects scrollbar, selection, and copying for the nk_text_edit state populated by nk_textedit_paste(). Confirm whether this is intended behavior and identify the relevant existing widget or documentation path; done means the expected read-only behavior and any required change are clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.