Live data from Hacker News

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

github.com

51–60 of 91 posts

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

#51
How can such a library be both tiny and portable, when the C standard library has no graphics facilities? Don't you need to lay down a lot of basis for different platforms and graphics backends, to be portable? And if you do that, how can you be tiny?

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

#52
post #5

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

I agree, and the lack of empathy around this area is sad. If you're developing an app, it is better to fall into the pit of success by using a UI framework that already has accessibility baked in. Any project that uses Dear Imgui for end-user applications has already made a bad design choice. AccessKit ( https://accesskit.dev/ ) seems to be a positive step forward, with some UI frameworks implemented (including immed…

It's supposed to be a _tiny_ library. Naturally its capabilities will tend towards being minimal. I don't expect decent RTL language support, for example, although it's quite important if those are the languages where you live.

As for linking to something written in Rust with bindings etc. - that is the opposite of tiny when you consider the dependencies, and it would not be portable to weaker or older systems.

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

#53

How can such a library be both tiny and portable, when the C standard library has no graphics facilities? Don't you need to lay down a lot of basis for different platforms and graphics backends, to be portable? And if you do that, how can you be tiny?

Almost all of these immediate mode UI libraries for C/C++ come without a rendering backend. Usually there are "example" implementations for libraries like SDL that you can use, or you implement your own backend. A lot of these libraries are popular for debug UIs in games and you probably need a custom backend for whatever graphics engine you use in your game.

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

#55

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 interesti…

pretty nifty but im trying to figure out what the use case for this is when its aimed at hobbyists ? I use pygtk and dont have to fiddle with lower level stuff

pygtk requires GTK, this library works with any rendering library that can draw rectangles and text

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

#56

Earlier quoted context omitted.

This is one of the reasons why web technology is so popular and persistent. You get almost all of that for free as long as you use semantic HTML.

Not true... this is why they had to add aria- ...

Yes, exactly! Now, it's all built into the platform.

The first WAI-ARIA specification was published in 2014 [0]. HTML5 became an official W3C recommendation that same year [1]. It includes semantic elements like and that have ARIA roles built in [2]. The Wikipedia page for WAI-ARIA includes the "five rules of ARIA" where the first rule is "Don’t use ARIA if you can achieve the same semantics with a native HTML element or attribute" [3].

You almost always still need some extra ARIA attributes to be fully accessible, but it's much less extra work than most other platforms and it works (mostly) the same on every operating system (including phones). You don't have to build anything yourself-- you just have to know which attributes to use. Just ask any blind people you know whether they prefer using a website or a native app.

[0] https://www.w3.org/TR/2014/REC-wai-aria-20140320/Overview.ht...

[1] https://www.w3.org/news/2014/html5-is-a-w3c-recommendation/

[2] https://www.w3.org/WAI/WCAG22/Techniques/html/H101

[3] https://en.wikipedia.org/wiki/WAI-ARIA

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

#57

I need something like this but with a few more bells and whistles.

The problem is always: you don't know beforehand what bells and whistles you will need. That's why Qt is probably the only safe bet (or Web/Electron if you don't mind the slower performance).

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

#58

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…

Genuine question; abandonware or complete? Something of this size serves as a nice substrate or starting-point regardless.

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

#59
post #57

I need something like this but with a few more bells and whistles.

The problem is always: you don't know beforehand what bells and whistles you will need. That's why Qt is probably the only safe bet (or Web/Electron if you don't mind the slower performance).

I know exactly what I need. I just built a task manager in C with GTK+. It uses the theming built into GTK to allow users to change themes while the program is running but it's too memory heavy for my taste. I also have a background in web dev and understand how to build for accessibility. Currently the memory allocated for every single process on my computer is https://github.com/hparadiz/evemon

You're right though I'm already thinking of scaling and hidpi as another thing I need.

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

#60
post #5

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

No. As much as I would like it to be the case, that is most certainly a poor criteria to evaluate a UI library. Dear ImGui [0] is without a doubt the most prevalent immediate mode UI library. It does not have native accessibility features, but that hasn't stopped companies such as Intel, Meta, IKEA and Google from shipping products built upon it. It's also used in a ton of games. Calling Dear ImGui a toy project at t…

You've cherry picked a very specific example that is designed to run in 3d engines. For anything rendering at standard OS api level level (the vast majority libs), accessibility is fine as evaluation criteria.
Post reply on HN