Hello,

Can anyone suggest a GUI library that meets the following criteria?

* Cross-Platform
* Doesn't control the main loop
* Not 100% object-oriented; similar to Xlib :)
* Not many pointers please (like FLTK that every object is a pointer)
* Free to use for closed source and open source software
* Lightweight

Thanks!

Dani AI

Generated

A short, practical summary for : a true “Xlib but cross‑platform” toolkit is rare because native widget toolkits are inherently platform‑specific. If the priorities are (a) you drive the loop, (b) a C/procedural style, (c) few pointer‑per‑object idioms, (d) a permissive license and (e) small footprint — the two pragmatic directions are (1) immediate‑mode header/C libraries you embed in your own loop, or (2) small C native‑widget wrappers you drive yourself via step/callback APIs. and pointed at larger toolkits; below are lighter alternatives that match the original constraints.

Nuklear is a single‑header, ANSI C immediate‑mode GUI you compile into your app; it provides a procedural API (no heavyweight class hierarchy), has minimal dependencies, and is offered under permissive terms. It doesn’t supply a windowing/main loop backend — you feed input and draw commands from your own loop, which sounds like exactly what you asked for. (See the repo for details and integration examples.) (github.com)

Dear ImGui is a lightweight C++ immediate‑mode library that’s extremely easy to integrate into an existing render/input loop and is licensed permissively (MIT). It’s aimed at tools/debug UIs (not “native” platform look or full accessibility), so it’s a great fit when you want low ceremony, fast iteration, and explicit control of the main loop. (github.com)

If you need a plain C API with native widgets, IUP (Tecgraf) is a mature procedural toolkit usable in commercial apps; it normally runs its own loop via IupMainLoop, but it also exposes IupLoopStep so you can pump it from an existing message loop if you must integrate it into a larger application. Read the docs and examples to confirm the integration model before committing. (tecgraf.puc-rio.br)

About LGPL (the license question from the thread): LGPL lets you link the library into proprietary apps, but it brings obligations (the library’s source or relinkable object code must be available and users must be able to replace the LGPLed library). If you want minimal legal friction for closed‑source distribution, prefer MIT/BSD/Zlib‑licensed toolkits. See the GNU LGPL text/FAQ for the exact rules. (gnu.org)

Links to check right away: Nuklear (GitHub), Dear ImGui (GitHub), IUP (Tecgraf product/docs) and the LGPL text. The immediate‑mode route (Nuklear/ImGui) is the closest match to an “Xlib‑style” low‑level, loop‑driven API while staying lightweight and permissively licensed. (github.com)

Recommended Answers

All 12 Replies

Ultimate++. It is well featured cross platform. I do not recommend gtk or qt coz they are lgpl. Vcf, efl, x, upp are bsd licence or similar. But i dont think x server makes sense

Ultimate++ seems just like wxWidgets, they are confusingly object-oriented. Is there a library that's similar to Xlib but cross-platform? Xlib's API is slightly object-oriented but not as confusing as the other libraries. It's also lightweight.

Please help.

BTW, what's bad with LGPL?

My Dad, a smart man, told me, "What a developer already knows or uses is sufficient... the time spent learning what he doesn't know or use is wasted". This is Dilbert Speak for, "Time moves on, bite the bullet.. someone's found a more expeditious, thoughtful solution to your stated goal. The poke in the eye is stepping back toward the drawing board to implement it."
Question: What is the most efficient, concise and expedient way to provide your solution to those who want it?

BTW - I'm a DOS dinosaur, C programmer from the neo-lithic.

You will know when you find it... hint.. C with classes.

Um, is that supposed to answer my question?

Cool quotes, they actually support my topic, but I'm looking for an easy-to-use GUI library.

Thank you for your time.

I, too would like such a library. I'm trying to figure out a way to use all the C++ I learned to make (possibly) multi-platform applications. I don't mind OOP, I don't mind pointers and I wouldn't even mind a big ol' IDE if the stupid thing WORKS!!
let's just say I've tried a few IDEs that don't work and were nothing more than a waste of bandwidth to download them.

Ultimate++ seems just like wxWidgets, they are confusingly object-oriented.

So you hate OOP? You are in trouble then! Only toolkit that AFAIK is not OOPed is GTK+.

Why is wxWidgets so confusing to you? Lazy to learn classes and pointers?

:
If you don't mind OOP and pointers, I would recommend Qt (it is easy, cross-platform, and comes with very decent, for windows, Mac and Linux).

@OP:
Just use SDL (Simple Directmedia Layer). It is not object-oriented at all (essentially a C library), has those good'ol' fashion handles and stuff instead of pointers. It is essentially has features similar to the win32 API, but for any platform (but you don't get any GUI elements really, although I'm sure there are plenty of add-on libraries that have buttons and menus and stuff).
But I would encourage you to face your fear of OOP and save yourself the trouble of trying to develop a GUI for your application in procedural programming (it will be a nightmare for you..). GUI programming is one of the prime applications where OOP makes a hell of a lot of sense (as opposed to other applications like numerical analysis where it still makes sense, but to a lesser degree).

commented: Well said +6

Ok, I downloaded and installed QT Creator. Does it work? OF COURSE NOT!!!! All it tells me is to run make install. What does this mean? Is make a program and install an argument to this program? Should I run this command from someplace in particular? I've tried it from more places than I can remember and all shell can tell me is that it doesn't work.
Would it kill the people who distribute Code::Blocks and QT Creator and Wx???, etc. to include INSTRUCTIONS ON HOW TO MAKE IT WORK? Are you kidding me?
I don't think you should be required to study a product FIRST before you can install it and use it. I think things like this should take care of themselves or at least include instructions for novices like me on how to do it!

"make" is one of the most common build tool for all medium to large scale programs. They don't give the instructions on it because very few programmers who go out to get Qt creator are not already very familiar with "make". And if you are a *nix user, that is a very common way to install software.

What you need to do (assuming you are under Linux), is go (in the terminal) to the folder in which you extracted the downloaded package, type "make" (if you downloaded the source files), then "make install", and you are done (NB: don't type in the quotation marks, of course). You can most probably also get it directly from the package repository with aptitude, with the following command (from any location, but from the terminal): "sudo apt-get install qtcreator", type in your password, and you're done.

If you are under windows, well, I'm sure the installer is a normal one (next, next, next... finished buttons!).

Of course, you need a compiler installed on your computer! Linux: gcc (install with "sudo apt-get install build-essentials") or Windows: MinGW

Hello,

Can anyone suggest a GUI library that meets the following criteria?

* Cross-Platform
* Doesn't control the main loop
* Not 100% object-oriented; similar to Xlib :)
* Not many pointers please (like FLTK that every object is a pointer)
* Free to use for closed source and open source software
* Lightweight

Thanks!

A solid GUI library that doesn't use pointers and isn't OOP? You're in trouble lol Like other people said just learn OOP and hone your pointer skills.

Hooray! Hooray! Hooray! Yesterday I downloaded and installed QT Creator for Linux (I have both UBUNTU and Mac OS X on my laptop) and without any further struggle or headache or anything I started a project, I got the user interface window, put on a label, changed the label to say, "Hello, World!" and I compiled it. IT WORKED!! It compiled on the first try and it really made a fully functional, free standing program that runs from the Linux GUI or even from the command window. I am a happy camper. Now, I need to learn the particulars of this environment so I can go invent the next Ms Pacman or something.
Thank you all for your help and encouragement!

Mark thread solved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.