Live data from Hacker News

MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

github.com

21–30 of 91 posts

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#23
post #9
post #5

The first thing I look for in any UI library is accessibility support. Makes it trivial to filter out toy projects.

Or, not every UI library is intended for use cases where a13y even makes sense. Like a debug UI in a game engine, or in an embedded device that doesn't even have input for a13y.

Being accessible to the intended users always matters. If you think it doesn't, that probably means it's currently accessible to those users (or that those who are it is inaccessible to have filtered themselves out, and are no longer users).

For example - in your debug UI, colorblind-friendly colors don't matter, until you hire your twelfth member of the team, who struggles to tell red and green apart.

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#24
post #5

The first thing I look for in any UI library is accessibility support. Makes it trivial to filter out toy projects.

Not very smart. I would go further and say that even full unicode support could be avoided and a software can still be massively useful.

It is sad that the world is so hung up on unicode and things like accessibility that we all have to submit to the tyranny of browser layers!

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#25
post #3

Immediate-mode in pure C is a nice constraint. how does it handle text rendering, do you bring your own atlas or is there something built in? Thats usually the part that balloons the dependency footprint.

it does not, it basically delegate that part to lower level library for which you have to write the glue code for, there is an example for SDL.

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#26
post #23
post #9

Earlier quoted context omitted.

Or, not every UI library is intended for use cases where a13y even makes sense. Like a debug UI in a game engine, or in an embedded device that doesn't even have input for a13y.

Being accessible to the intended users always matters. If you think it doesn't, that probably means it's currently accessible to those users (or that those who are it is inaccessible to have filtered themselves out, and are no longer users). For example - in your debug UI, colorblind-friendly colors don't matter, until you hire your twelfth member of the team, who struggles to tell red and green apart.

This library's default is greyscale anyway, so it's by default colorblind friendly.

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#27

This has been my goto for personal toy projects for a while now. Trivial to slot in to basically anything that can display text and takes mouse input. I will mention, however, it's kinda abandonware at this point. There is some bug with the draw call iterator which does a misaligned pointer access, which, if your environment is set up to catch that, can get annoying (Zig for example panics on it). There's a github is…

> it's kinda abandonware at this point

That's sad. I'm a fan of rxi's work, including this one.

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#28
post #5

The first thing I look for in any UI library is accessibility support. Makes it trivial to filter out toy projects.

What? On a micro immediate mode UI? Really insane comment TBH

The point of a UI library is to interface with users. If it totally fails to interface with a subset of users then it is obviously deficient to some degree. It is callous and foolish to dismiss offhand users who rely on assistive technologies. You probably have a poor idea of who they are and how many people we’re talking about. You never know when you or someone you care about will become one of them, even temporarily. You never know how far your software will reach when you write it.

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#29
I wrote a little demo to run microui on top of the sokol headers here, it's really interesting in how minimal it is.

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

Source code: https://github.com/floooh/sokol-samples/blob/master/sapp/sgl...

The renderer backend is just a bunch of C functions you need to provide:

https://github.com/floooh/sokol-samples/blob/3f4185a8578cd2b...

It's also interesting to compare the binary sizes:

microui sample (https://floooh.github.io/sokol-html5/sgl-microui-sapp.html): 79.6 KBytes compressed download

Nuklear sample (https://floooh.github.io/sokol-html5/nuklear-sapp.html): 155 kb compressed download

Dear ImGui sample (https://floooh.github.io/sokol-html5/imgui-sapp.html): 491 KB compressed download

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#30

how is this different from lvgl? is this immediate mode or retained mode?

Very different, starting at the line count:

Lvgl is 440kloc across 1134 files (in the src directory), while microui is 1121 lines of code in one .c and one .h file.

Microui is immediate mode, very minimal and 'bring your own renderer'. Probably most useful for adding a small debugging UI to a 3D game/app.

Post reply on HN