Nuklear icon indicating copy to clipboard operation
Nuklear copied to clipboard

`nk_style_slider` and `nk_style_scrollbar`'s `show_buttons` member typing is incorrect

Open Emily-TTG opened this issue 6 months ago • 2 comments

nk_style_slider and nk_style_scrollbar's show_buttons member is int instead of nk_bool. This causes an issue with nk_checkbox_label and the like where the passed pointer can cause a mismatch if NK_INCLUDE_STANDARD_BOOL is set.

This manifests in the configurator demo in both structures' respective functions.

Emily-TTG avatar May 29 '25 17:05 Emily-TTG

Possibly related to https://github.com/Immediate-Mode-UI/Nuklear/issues/849 Probably caused by https://github.com/Immediate-Mode-UI/Nuklear/pull/185

sleeptightAnsiC avatar Nov 16 '25 23:11 sleeptightAnsiC

Hello, @Emily-TTG. Thanks a lot for reporting this.

The underlying issue was introduced after PR #185 was merged. Besides that, it results in undefined behavior in style_configurator.c whenever nk_bool is redefined to a type other than int.

https://github.com/Immediate-Mode-UI/Nuklear/blob/9afb3dd6d14fba0c5e62f08809b494b6d580b9b1/demo/common/style_configurator.c#L302 as well as https://github.com/Immediate-Mode-UI/Nuklear/blob/9afb3dd6d14fba0c5e62f08809b494b6d580b9b1/demo/common/style_configurator.c#L383

PavelSharp avatar Nov 16 '25 23:11 PavelSharp