Libui: a portable GUI library for C
111–120 of 164 posts
Re: Libui: a portable GUI library for C
#112I was just reading ui.h. It's been quite a while since I wrote anything in C so this might be a dumb question, but does C not have namespaces? How can major projects use third party libraries and not have to deal with naming collisions?
Re: Libui: a portable GUI library for C
#113I was just reading ui.h. It's been quite a while since I wrote anything in C so this might be a dumb question, but does C not have namespaces? How can major projects use third party libraries and not have to deal with naming collisions?
No, C doesn't have namespaces as a language feature. Guess why all the function names start with ui .
Clearly it must not be a problem, I just don't understand how people work around it.
Re: Libui: a portable GUI library for C
#114It should be set to prototype by default.
Re: Libui: a portable GUI library for C
#115Earlier 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…
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) .
In fact the main open source project I'm working on automatically generates it's documentation to help ensure its accuracy - and I know for a fact that I'm not the only person to do this.
Re: Libui: a portable GUI library for C
#116A lot of the comments have mentioned the lack of documentation this project has, and then they've received replies of the form "you should submit a pull request, the author doesn't owe you anything". Here's my take on it: I don't owe the author anything either. But if I'm considering which project to use, I'd probably choose the one with documentation, since it signals better goals and higher code quality. It's absur…
I agree with your point about reading the signals of which projects are probably the best.
But with great power comes great responsibility. It's entirely possible YOU are the person who makes this project great, just by the Butterfly Effect of getting the documentation good enough that the next person who comes along will be willing to choose this and push a little harder, and so on.
You're not forced. You're not obligated.
But if you show up, you get to make decisions.
Re: Libui: a portable GUI library for C
#117Earlier quoted context omitted.
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.
Re: Libui: a portable GUI library for C
#118Earlier quoted context omitted.
I work for many years with FFMpeg that has no documentation and no code sample, and it's okay for me. I prefer that the developers keep their time optimizing the code rather than writing documentation that needs to be maintained and become a problem when not in sync. My state of mind is that if it's open source then just read the code.
FFMpeg is not some random project - it's irreplaceable and very popular.
Re: Libui: a portable GUI library for C
#119Another 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
I had my eye on yue, but it does not seem that a Golang port exists. Persoanally I would like a guide (hints) to port it to Golang or other language.
Re: Libui: a portable GUI library for C
#120Earlier quoted context omitted.
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.
I wouldn't say it looks like garbage, but if you want a more native look and feel you could certainly set it up in the settings.
(For example: you could look at https://stackoverflow.com/questions/37035936/how-to-get-nati... )
As a library purely coded in C, I still believe that GTK and GNOME lay a solid foundation for easy development in C.
Before downvoting you might want to give GTK another chance. Even this libui library uses GTK under the hood for linux.