Live data from Hacker News

Libui: a portable GUI library for C

github.com

61–70 of 164 posts

Re: Libui: a portable GUI library for C

#61
I wish more projects lile this existed. Most of the tools don't need a huge UI but something simple to install and well integrated is very much needed.

I like the toga project in python : https://pybee.org/project/projects/libraries/toga/

Tkinter is terribly integrated and QT hard to install so toga hits a sweet spot. But it's very immature.

My favorite toolkit is still wx, however it just reached V3 compat so it's considered unstable. You can pip install it (well, linux support is so so yet) and all the UI looks native, including the file dialogs.

Re: Libui: a portable GUI library for C

#62
post #57

Earlier quoted context omitted.

>Does it take ownership of options, a struct with a single size_t. This is a bit extreme. My first thoughts (honestly) is yes, what is the size of. Following their advice to follow their examples, I looked at examples and it literally just zeros a uiInitOptions on the stack and sends it in. Thus I think it's something I wouldn't really need to care about usually. As for whether I need to worry about saving 8 bytes on…

...not to mention that this is obviously a work in progress. We're looking at a project's github page, not a product release page. I would think that like with a lot of coding projects, you start with an initial idea and see where it takes you, rather than with a full specification that you then follow. Given the limited resources of a single programmer, writing an extended documentation early on and then keeping it…

Yes, sorry—I should have been abundantly clear that I was responding only to the "You can figure it out yourself from the header file, you don't need docs" point. If it's an unfinished or hobby project, great! Those are cool, and I don't mean to discourage them / place high bars on them existing in public, and I am super sorry for not being clear about that.

Hobby or personal-interest projects with an expectation of no real use don't need externally-facing documentation because they have no externally-facing APIs at all, not because their APIs are obvious.

Re: Libui: a portable GUI library for C

#63

Another option (C++ LGPL w/ Lua,JS bindings): https://github.com/yue/yue Other projects building on andlabs/ui and https://github.com/parro-it/libui-node : https://github.com/mimecorg/vuido - vue https://github.com/kusti8/proton-native - react

Another one:

https://github.com/zserge/webview

Re: Libui: a portable GUI library for C

#64

I wish more projects lile this existed. Most of the tools don't need a huge UI but something simple to install and well integrated is very much needed. I like the toga project in python : https://pybee.org/project/projects/libraries/toga/ Tkinter is terribly integrated and QT hard to install so toga hits a sweet spot. But it's very immature. My favorite toolkit is still wx, however it just reached V3 compat so it's c…

I think GTK is an excellent library for C. If you use Glade and GTKBuilder, you don't have to write the boilerplate either. You design you UI in Glade visually, add your signals, set your id's etc. Then you save your design as an XML file. In your C code you load that design with a simple function, then assign the function names for the signals you've created in the visual designer. Then you're all set to go.

The library (GTK) feels the same in every language, whether it's C, Python, Go, etc.

I admit, it can be a hassle to get the library up and running, but once you do that, it is surprisingly simple to code in.

Re: Libui: a portable GUI library for C

#65
post #60
post #50

Earlier quoted context omitted.

I am quite oposite, I want example code using as much aspects of library as possible - sort of "a picture is worth a thousand words". Documentation is nice to have, but I personally consider a well written code a documentation, and it doesnt get outdated ;) Have you checked this: https://github.com/andlabs/libui/blob/master/examples/contro... ?

Firstly, good documentation will include example code anyway. That's part of the course of documenting. Secondly, exams code can get outdated just as much as human documentation. I've lost count of the number of times I've gone to compile example code only to find it doesn't work because of API changes or such like. I've also had example code crash my whole machine because it effectively created a fork bomb (thanks M…

Outdated examples can be mostly avoided by building them as part of CI and if possible running. Using deprecated attribute can even detect some of the cases when example builds but doesn't match recommended way of doing things.

Re: Libui: a portable GUI library for C

#66

I wish more projects lile this existed. Most of the tools don't need a huge UI but something simple to install and well integrated is very much needed. I like the toga project in python : https://pybee.org/project/projects/libraries/toga/ Tkinter is terribly integrated and QT hard to install so toga hits a sweet spot. But it's very immature. My favorite toolkit is still wx, however it just reached V3 compat so it's c…

I think GTK is an excellent library for C. If you use Glade and GTKBuilder, you don't have to write the boilerplate either. You design you UI in Glade visually, add your signals, set your id's etc. Then you save your design as an XML file. In your C code you load that design with a simple function, then assign the function names for the signals you've created in the visual designer. Then you're all set to go. The lib…

The UI's look like garbage on anything non linux though.

Re: Libui: a portable GUI library for C

#67
post #60
post #50

Earlier quoted context omitted.

I am quite oposite, I want example code using as much aspects of library as possible - sort of "a picture is worth a thousand words". Documentation is nice to have, but I personally consider a well written code a documentation, and it doesnt get outdated ;) Have you checked this: https://github.com/andlabs/libui/blob/master/examples/contro... ?

Firstly, good documentation will include example code anyway. That's part of the course of documenting. Secondly, exams code can get outdated just as much as human documentation. I've lost count of the number of times I've gone to compile example code only to find it doesn't work because of API changes or such like. I've also had example code crash my whole machine because it effectively created a fork bomb (thanks M…

In an attempt to mitigate this, you could include the examples in your testing suite, at least to see that it still compiles properly. This is sort of standardised in the flow of Go, with godoc and the testing framework. Both uses examples from the same test files, producing standalone docs and testing them(at a minimum compiling them) .

Re: Libui: a portable GUI library for C

#68
How does it compare to wxwidgets? I have used neither of these. I need a platform independent(mac/Linux/windows) GUI for a upcoming project and I was comparing Qt and wxwidgets and decided to use wxwidgets. Now wonder whether I can use libui instead of wxwidgets?

Re: Libui: a portable GUI library for C

#69
post #65
post #60

Earlier quoted context omitted.

Firstly, good documentation will include example code anyway. That's part of the course of documenting. Secondly, exams code can get outdated just as much as human documentation. I've lost count of the number of times I've gone to compile example code only to find it doesn't work because of API changes or such like. I've also had example code crash my whole machine because it effectively created a fork bomb (thanks M…

Outdated examples can be mostly avoided by building them as part of CI and if possible running. Using deprecated attribute can even detect some of the cases when example builds but doesn't match recommended way of doing things.

Sure, but that would depend on project contributors doing that as part of their process. Which leads us back to square one on 'core documentation should not be something that has to be submitted via pull request.'

Re: Libui: a portable GUI library for C

#70

I wish more projects lile this existed. Most of the tools don't need a huge UI but something simple to install and well integrated is very much needed. I like the toga project in python : https://pybee.org/project/projects/libraries/toga/ Tkinter is terribly integrated and QT hard to install so toga hits a sweet spot. But it's very immature. My favorite toolkit is still wx, however it just reached V3 compat so it's c…

I think GTK is an excellent library for C. If you use Glade and GTKBuilder, you don't have to write the boilerplate either. You design you UI in Glade visually, add your signals, set your id's etc. Then you save your design as an XML file. In your C code you load that design with a simple function, then assign the function names for the signals you've created in the visual designer. Then you're all set to go. The lib…

The problem is it's not well integrated on anything else than Gnome. If you are on KDE, Windows or Mac, stuff like the file picker will make the experience painful.

Even electron apps don't try to reinvent this one and pop the OS widget.

Post reply on HN