Live data from Hacker News

Nuklear – A single-header ANSI C immediate mode cross-platform GUI library

github.com

1–10 of 103 posts

Re: Nuklear – A single-header ANSI C immediate mode cross-platform GUI library

#3
Here's a simple WASM version of the Nuklear standard demo:

https://floooh.github.io/sokol-html5/nuklear-sapp.html

The big difference to Dear ImGui is that Nuklear has a C API and is also implemented in C - and apparently it has more skinning/themeing options, which I haven't tinkered with yet.

TBH, for tools I prefer cimgui (a C wrapper around Dear ImGui), my impression is that Nuklear has a 'purer' immediate-mode design at the cost of some convenience, while Dear ImGui has a more pragmatic design approach, but also has less friction for writing UI code. I haven't needed skinning options so far though, that might be the actual USP of Nuklear.

It all might also just be personal bias, because I used Dear ImGui before Nuklear :)

For shits'n'giggles, here's both UI systems in the same application:

https://floooh.github.io/sokol-html5/nuklear-sapp-ui.html

(the menu bar and all windows that open from it is Dear ImGui, the rest is Nuklear).

Re: Nuklear – A single-header ANSI C immediate mode cross-platform GUI library

#4

Here's a simple WASM version of the Nuklear standard demo: https://floooh.github.io/sokol-html5/nuklear-sapp.html The big difference to Dear ImGui is that Nuklear has a C API and is also implemented in C - and apparently it has more skinning/themeing options, which I haven't tinkered with yet. TBH, for tools I prefer cimgui (a C wrapper around Dear ImGui), my impression is that Nuklear has a 'purer' immediate-mode de…

> https://floooh.github.io/sokol-html5/nuklear-sapp-ui.html

The check-box being an empty square when it's checked, and a filled square when it's unchecked is an unpopular design decision.

Re: Nuklear – A single-header ANSI C immediate mode cross-platform GUI library

#6
post #5

Interesting, this seems more resource efficient than even fltk, which is the lightest usable cross-platform GUI library. And it's pure C unlike fltk. It's great to see such projects in an era of unabashed resource consumption.

The price for the 'lightest' general UI toolkit probably goes to microui:

https://github.com/rxi/microui

Just around 1100 lines of C code.

You need to bring your own renderer, but that's the same for Nuklear or Dear ImGui.

I wrote a WASM wrapper for the microui demo too:

https://floooh.github.io/sokol-html5/sgl-microui-sapp.html

Re: Nuklear – A single-header ANSI C immediate mode cross-platform GUI library

#7
post #4

Here's a simple WASM version of the Nuklear standard demo: https://floooh.github.io/sokol-html5/nuklear-sapp.html The big difference to Dear ImGui is that Nuklear has a C API and is also implemented in C - and apparently it has more skinning/themeing options, which I haven't tinkered with yet. TBH, for tools I prefer cimgui (a C wrapper around Dear ImGui), my impression is that Nuklear has a 'purer' immediate-mode de…

> https://floooh.github.io/sokol-html5/nuklear-sapp-ui.html The check-box being an empty square when it's checked, and a filled square when it's unchecked is an unpopular design decision.

Not just unpopular, it seems totally misleading and plain wrong to me. I've also seen elsewhere something similar, like checkboxes used instead of checkmarks as output widgets on web pages; cannot recall where though.

Re: Nuklear – A single-header ANSI C immediate mode cross-platform GUI library

#9
I've been using nanogui[0] to fit the bill for personal uses.

To be honest though, I'm at the point where I'd really prefer an easy and lightweight library to setup a http and/or websocket server, and just make a ui in the browser. I've got a simple use case -- I'm just making a simple scene editor & debugging ui for a toy ray tracer.

I know there are a ton of different libraries out there for the task, but that just makes it hard to evaluate the quality of any given library. I haven't given any a shot, I've only gone so far as to look at them and ponder what the size of the user base is, and question if the project will go inactive in a couple years. Or if it's going to require me to pull in some other host of dependencies.

Recommendations from HNers welcome!

[0] https://github.com/mitsuba-renderer/nanogui

Re: Nuklear – A single-header ANSI C immediate mode cross-platform GUI library

#10
post #5

Interesting, this seems more resource efficient than even fltk, which is the lightest usable cross-platform GUI library. And it's pure C unlike fltk. It's great to see such projects in an era of unabashed resource consumption.

The price for the 'lightest' general UI toolkit probably goes to microui: https://github.com/rxi/microui Just around 1100 lines of C code. You need to bring your own renderer, but that's the same for Nuklear or Dear ImGui. I wrote a WASM wrapper for the microui demo too: https://floooh.github.io/sokol-html5/sgl-microui-sapp.html

I love these kinds of UI frameworks except for one thing -- the text is always so poorly rendered. Not sure if it's just poor fonts or lack of good antialiasing, but compared to how a browser or native windowing system renders text, immediate mode GUIs are practically unbearable and make me want to close them after short usage. Maybe because I use a high-DPI screen (Macbook Air), not sure, but it feels like taking a step in the wrong direction for user comfort.
Post reply on HN