Page 1 of 1

What GUI library to use?

Posted: Sun Dec 04, 2011 1:54 pm
by dany
Over the years I've done quite some programming and scripting in various languages. Save two exceptions my scripts and programs are all written as command line tools, I work a lot with Linux and when on Windows I use MinGW continuously. Great environment and I've grown accustomed to doing my automation in sh/perl/python and often simple C/C++ when I really want speed. But learning/working with AutoIt and playing around with windows and controls and all that fun inspired me to wrap some of my C stuff in a GUI.
The two exceptions mentioned above were done years ago in perl and that was a PITA. Never going back there, getting user input from STDIN is much easier.
Python also has some cool tools in this department apart from TkInter like XGui, Lucid and Kivy (touchscreen support!), but I'd prefer something that I can use in C/C++.

But what library to use?
Actually a better question is: What library do you portable freeware users prefer to see?
Qt (formerly by TrollTech) isn't stealth and rather bloated (no need for a complete framework), GTK is ok to work with as I've heard but can look crap in certain OS-es (this was maybe only true 5 years ago) and wxWidgets is afaik just a wrapper for GTK but I could be wrong. And then I've also found Ultimate++ and eGUI++.
Like I said, I've got no experience with any of them, so it's hard for me to judge them and make a choice. I'm a bit reluctant to go with one of the lesser known libraries as it's hard to tell if it will still be around in 5 years. Google turns up a lot of them, but a lot also seem quite dead...

My wishlist:
  • Portable and if possible completely stealth.
  • Cross-platform. Since I don't use Apple I personally don't care for supporting it, but support for all three major OS would be great.
  • I prefer source that can be used and included at compilation over an external dll that has to be linked. Not a big priority though.
  • freeware-friendly licensing. Open-source preferred, studying source is the best teacher.
  • Lightweight. Or at least as lean as it can be.
I'm looking forward to any opinions and suggestions you might have.

Re: What GUI library to use?

Posted: Sun Dec 04, 2011 6:43 pm
by kAlug
I'd suggest wxWidgets. It's not only a wrapper for GTK+, it wraps the native GUI toolkit (being thus cross-platform). It's stealth, licensed under a custom LGPL, and seems to allow static linking (guessing from the fact FileZilla doesn't include its DLLs).
I don't know how lightweight it is; I just can tell you that the main FileZilla executable, not compressed with UPX and including debug information, is 7.8MiB. Pretty small, compared to Qt.

Re: What GUI library to use?

Posted: Mon Dec 05, 2011 1:34 am
by m^(2)
As a user, I strongly prefer wxWidgets and SWT over ones like GTK and Swing. The reason is that alien widgets drawn by the library always seem to look totally out of place on some or all operating systems out there. It significantly reduces user satisfaction, especially the so important first impression. In some cases it reduces productivity too, when working on Windows, I can't really find my way with GTK open file dialog.
And I did a little development with wxPython and the library was OK. Can't really compare to others, I'm not a GUI developer, but learning it went smooth and I didn't see any problems with it.

Re: What GUI library to use?

Posted: Mon Dec 05, 2011 8:37 am
by dany
Thanks for the replies.
wxWidgets.org wrote:wxWidgets gives its applications a truly native look and feel because it uses the platform's native API rather than emulating the GUI.
I don't know why I thought wxWidgets was just a wrapper...
The minimal executable size (static linked & unpacked) of a 'hello world' or something is about 1 Mb in MinGW, but that also includes all the overhead of wxWidgets, e.g. all the classes not used by the program. That's according to the FAQ.

I also came across JUCE. Looks very interesting and also meets almost anything on my wishlist. I haven't looked thoroughly at the source yet, but as far as I can tell it also uses native components for GUI building. And: reduces overhead by configuring to only include those classes needed by the program. But I'm pretty sure wxWidgets provides that feature as well.
m^(2) wrote:The reason is that alien widgets drawn by the library always seem to look totally out of place on some or all operating systems out there.
So after five years that's still true.

Well, I'll be diving into the wxWidgets docs for now.
Thanks for the suggestions, and keep it coming.

Re: What GUI library to use?

Posted: Tue Mar 20, 2012 9:41 am
by vmars316
Dany,
Have a look into WINE and VALA.
Might save you a lot of time.

I have been thinking about a similar program for 'C'.
I am just learning 'C' now from 'K&R'.
Wine and Vala look promissing to me.
But I am a bit overwhelmed by what to download, and where to.

Otherwise, I would probably write the program in HotBasic.
HotBasic is very fast and NOT verbose.
I have some freeware with HB-source here: http://www.vmars316.com

Anyways, is this Post the best way to keep abreast of your progress?
Thanks...Vernon