What's A Good Ui Library?


Spectralist

Still Fresh
Joined
Nov 14, 2007
Messages
68
I've only ever programmed for Windows and so have never bothered looking for an alternative to the Win32 API. But i've got a project planned that i would love to be compatible with both Windows & Pandora. But of course i don't want to have to write the UI/Message handling code twice. I've looked into SDL but it seems pretty much exclusively games oriented(and this project isn't a game) and while its message handling would do it doesn't seem to have anything built in for dialogue boxes/extra windows/other ui functions that i don't want to have to maintain two/multiple versions of.

Googling around i found wxWidgets which looks like it might have everything i need. Anyone have any experience with it? Will it be compatible with Pandora's Angstrom? Is there a better option you can suggest?
 
For cross platform, probably Qt.

Edit: It runs on Windows, Linux, it's what KDE is based off of, Nokia is using it for their latest cell phones - up till now they were using GTK, and it may run on Mac - I haven't checked that.

Edit: Removed an extra it.
 
Spectralist said:
I've only ever programmed for Windows and so have never bothered looking for an alternative to the Win32 API. But i've got a project planned that i would love to be compatible with both Windows & Pandora. But of course i don't want to have to write the UI/Message handling code twice. I've looked into SDL but it seems pretty much exclusively games oriented(and this project isn't a game) and while its message handling would do it doesn't seem to have anything built in for dialogue boxes/extra windows/other ui functions that i don't want to have to maintain two/multiple versions of.

Googling around i found wxWidgets which looks like it might have everything i need. Anyone have any experience with it? Will it be compatible with Pandora's Angstrom? Is there a better option you can suggest?
Qt.

Runs on all platforms known to man (Windows, Mac, Linux, BSD, mobile phones, PDAs, etc), has very awesome features (Animation APIs, XML processing, scripting support, the complete Webkit HTML rendering system, cross-platform OpenGL, separation between UI and associated code, an event system, etc.)

Qt is used by various systems such as Google Earth, Skype, the KDE desktop environment, etc. Very many critics agree that it is the best UI toolkit there is in existence.

To develop Qt software, either link Qt libraries like any other C++ library, or use the, also very awesome, complete IDE for Qt development: Qt Creator. Some claim that it is superior to even VisualStudio, and I use it for all my C++ projects where I need rapid prototyping, and absolutely love it.

Qt beginners tutorial: http://doc.trolltech.com/4.3/tutorial.html
New tutorial, for the newest Qt version (v4.5): http://doc.trolltech.com/4.5/tutorials.html
Alternative older tutorial: http://www.digitalfanatics.org/projects/qt_tutorial/

EDIT: lol, both me and the previous poster suggested Qt right off the bat. That just proves my "point".
 
Last edited by a moderator:
Anyone knowledgeable have any advice (or can offer a good compare/contrast) as to GTK vs. Qt? I'm more wondering for educational purposes - I'm probably not going to be using either any time especially soon.
 
Vorporeal said:
Anyone knowledgeable have any advice (or can offer a good compare/contrast) as to GTK vs. Qt? I'm more wondering for educational purposes - I'm probably not going to be using either any time especially soon.

I'm not an expert, but this is my understanding of the differences:

  • GTK is written in C and uses a GObject-based object model, while Qt is completely written in C++ and uses object-oriented design principles.
  • GTK itself can only do drawing and widget management, while Qt has many other integrated auxiliary features like XML parsing, HTML rendering and OpenGL acceleration (as I said above). You can still use GTK and get access to similar features, however, since GTK integrates very well with other libraries that also use the GObject model, like Clutter and the D-BUS. So, if you target Qt, you get everything in one integrated package, while if you use GTK, you pick and choose what you want to use yourself and use it in tandem.
  • GTK generally has a more language-agnostic design, meaning that you can use it from scripting languages, etc. Of course, you can use Qt in other languages than C++, as well, but the integration generally isn't as good. The result of this is of course that Qt generally is much faster than GTK when used in scripts or other programming languages.
  • GTK uses a more conservative development policy, meaning that you generally use "gcc" and "make" when developing for GTK. Qt, on the other hand, uses tools that are optimized for Qt software, like for example "qmake", a tool similar in functionality to "make", but "qmake" works better in cross-platform environments since it doesn't rely on platform-specific tools. Of course it's possible to use the classic tools with Qt as well, but this is generally not preferred.
  • Qt generally has more "advanced" systems in the sense that simplicity sometimes is sacrificed for efficiency or appearance gains. The Qt widget system, for instance, relies on a very hierarchical and complex layout system that makes the resizing of windows smoother, adjacent widgets look like they "belong together" by using cross-border coloring, and makes UIs more usable at different screen sizes. This, however, has the disadvantage that it sometimes is difficult to position Qt widgets exactly where you want them. GTK, on the other hand, uses the classical container/sequential layout system, which makes it easier to position widgets, but has the side effect that layouts sometimes get messed up when resized.
  • Qt extensions are generally written in C++ for the extra performance, while GTK uses various configuration and meta-files to construct extensions. GTK themes, for example, use a custom "gtkrc" format in combination with rendering engines which makes it easy to create themes for GTK, while Qt themes generally are written in C++ (aka there is no configuration part, just the theme engine part), which makes them look "nicer" but makes it more difficult for novices to write them.
  • Qt is more modern than GTK, since it is updated more often than GTK and has gotten a lot of programmer attention recently. All Qt applications support transparency (ARGB pixmaps) natively, for example, while you need to use various extensions in GTK to allow for the same effect.
 
Last edited by a moderator:
dflemstr said:
  • GTK is written in C and uses a GObject-based object model, while Qt is completely written in C++ and uses object-oriented design principles.
Gtk does use object-oriented design principles, too.

My suggestion would be to look into PyQt or PyGtk. IMHO PyGtk is better and easier to program with while PyQt does look better on Windows.

Whatever you decide to do, please don't use wxWidgets! It has been a while ago since I've tested it, but it was buggy, the documentation was incomplete and it was bad C++ (macros etc.). It could have changed, but I would just use Qt. And because Python is thousand times better than C++, use PyQt!
 
Last edited by a moderator:
dflemstr said:
Limestraël said:
Jan-Nik said:
Python is thousand times better than C++

+1!
Define "better", please.
Produce more in less time. Well, there are cases in which C++ might be better (like games).

Anyway, let's not start a language/toolkit flame war. That python is better then C++ is just my opinion. And when we talk about UI programming PyQt seems much better and easier to me than C++/Qt.
 
Last edited by a moderator:
dflemstr said:
I can argue that Qt Jambi + Scala is far superior compared to C++ and Python, but I won't because this isn't a language discussion.

Scala seems to be to you like a holy grail, huh?
To me, Python is.
I personnaly totally dislike Java (low consistency, not easy to use, slow development...), I know that Scala's based on it (and is made to communicate with it) but I don't know if it has improved the big defects of Java.
 
Last edited by a moderator:
Limestraël said:
Scala seems to be to you like a holy grail, huh?
Pretty much :D
I discovered it a couple of moths ago and it has never let me down.
Limestraël said:
To me, Python is.
I personnaly totally dislike Java (low consistency, not easy to use, slow development...), I know that Scala's based on it (and is made to communicate with it) but I don't know if it has improved the big defects of Java.
The only bad thing that Scala has because it is based on Java, is generic type erasure, which means that you can't pattern match against objects with generic types. Not really that bad, however, since you'll never need to pattern match generic types anyways if you are a competent programmer.
I think that the fact that Scala comes close to C performance while having an even "easier" syntax than for example Python and features that don't exist in any other language, makes it a language that is suitable for a lot of situations.

The reason why I always tend to recommend Scala is that it SPECIFICALLY is DESIGNED to be usable both as a scripting language and as a language used for supercomputer programs.

There's a talk by Martin Odersky that explains this further (the first 5 minutes of the video kinda brings the point across that I'm trying to make):
.
 
Last edited by a moderator:
Spectralist said:
I've only ever programmed for Windows and so have never bothered looking for an alternative to the Win32 API. But i've got a project planned that i would love to be compatible with both Windows & Pandora. But of course i don't want to have to write the UI/Message handling code twice. I've looked into SDL but it seems pretty much exclusively games oriented(and this project isn't a game) and while its message handling would do it doesn't seem to have anything built in for dialogue boxes/extra windows/other ui functions that i don't want to have to maintain two/multiple versions of.

Googling around i found wxWidgets which looks like it might have everything i need. Anyone have any experience with it? Will it be compatible with Pandora's Angstrom? Is there a better option you can suggest?

I program primarily in C, and I use wxWidgets when I need to make the occasional cross-platform GUI. C++ is different and scary to me, but I really like wxWidgets: it is very easy to use, and comes with a large number of utility functions that I find myself using even when I am not making GUI's. I'm told wxWidgets is a lot like MFC for Windows programming.

I probably should say that part of what makes it so easy for me to use, though, is Dialogblocks. This is a GUI builder that also performs a lot of the setup for WX on whatever platform you like. It will compile wxWidgets (in Windows or linux, and on the Mac too I guess), generate Makefiles to compile your code (for Windows or linux) and it will even make Visual Studio solutions if that is your thing. Typically, I use Dialogblocks to generate GUI's and Makefiles, and then I edit code in whatever tool I like (vim on linux and VS in windows). You can download an "Unregistered" version of Dialogblocks for free. It is crippled in that it will only allow 30 (I think) elements in a window. You can register for $90 (again, I think).
 
Last edited by a moderator:
manimal said:
Spectralist said:
I've only ever programmed for Windows and so have never bothered looking for an alternative to the Win32 API. But i've got a project planned that i would love to be compatible with both Windows & Pandora. But of course i don't want to have to write the UI/Message handling code twice. I've looked into SDL but it seems pretty much exclusively games oriented(and this project isn't a game) and while its message handling would do it doesn't seem to have anything built in for dialogue boxes/extra windows/other ui functions that i don't want to have to maintain two/multiple versions of.

Googling around i found wxWidgets which looks like it might have everything i need. Anyone have any experience with it? Will it be compatible with Pandora's Angstrom? Is there a better option you can suggest?

I program primarily in C, and I use wxWidgets when I need to make the occasional cross-platform GUI. C++ is different and scary to me, but I really like wxWidgets: it is very easy to use, and comes with a large number of utility functions that I find myself using even when I am not making GUI's. I'm told wxWidgets is a lot like MFC for Windows programming.

I probably should say that part of what makes it so easy for me to use, though, is Dialogblocks. This is a GUI builder that also performs a lot of the setup for WX on whatever platform you like. It will compile wxWidgets (in Windows or linux, and on the Mac too I guess), generate Makefiles to compile your code (for Windows or linux) and it will even make Visual Studio solutions if that is your thing. Typically, I use Dialogblocks to generate GUI's and Makefiles, and then I edit code in whatever tool I like (vim on linux and VS in windows). You can download an "Unregistered" version of Dialogblocks for free. It is crippled in that it will only allow 30 (I think) elements in a window. You can register for $90 (again, I think).
*cough, cough*
That is in no way unique to wxWidgets; you can do that with every toolkit out there.
qtcreator.png
 
Last edited by a moderator:
dflemstr said:
manimal said:
Spectralist said:
I've only ever programmed for Windows and so have never bothered looking for an alternative to the Win32 API. But i've got a project planned that i would love to be compatible with both Windows & Pandora. But of course i don't want to have to write the UI/Message handling code twice. I've looked into SDL but it seems pretty much exclusively games oriented(and this project isn't a game) and while its message handling would do it doesn't seem to have anything built in for dialogue boxes/extra windows/other ui functions that i don't want to have to maintain two/multiple versions of.

Googling around i found wxWidgets which looks like it might have everything i need. Anyone have any experience with it? Will it be compatible with Pandora's Angstrom? Is there a better option you can suggest?

I program primarily in C, and I use wxWidgets when I need to make the occasional cross-platform GUI. C++ is different and scary to me, but I really like wxWidgets: it is very easy to use, and comes with a large number of utility functions that I find myself using even when I am not making GUI's. I'm told wxWidgets is a lot like MFC for Windows programming.

I probably should say that part of what makes it so easy for me to use, though, is Dialogblocks. This is a GUI builder that also performs a lot of the setup for WX on whatever platform you like. It will compile wxWidgets (in Windows or linux, and on the Mac too I guess), generate Makefiles to compile your code (for Windows or linux) and it will even make Visual Studio solutions if that is your thing. Typically, I use Dialogblocks to generate GUI's and Makefiles, and then I edit code in whatever tool I like (vim on linux and VS in windows). You can download an "Unregistered" version of Dialogblocks for free. It is crippled in that it will only allow 30 (I think) elements in a window. You can register for $90 (again, I think).
*cough, cough*
That is in no way unique to wxWidgets; you can do that with every toolkit out there.

Ummm.... right. Well, you see, the original poster asked if anyone had any experience with wxWidgets. Since I do, I wrote in and said that I liked it, and that I particularly like using wxWidgets with Dialogblocks. Is this ok? If I implied that what I like is better than what you like, I didn't mean to, and I apologize.
 
Last edited by a moderator:
If you're looking for something SDL-based, look at the Agar library. You'll do fine with wxWidgets also but it generally layers itself on top of another GUI library in the system used thus taking up extra RAM. QT is also good if it is already being used elsewhere in the system, otherwise leave it. GTK+ is ok too if it is used elsewhere in the system. Most Linux systems use either QT/KDE, Gnome/GTK+, or XFCE so just find out which GUI system is used by the base system for Angstrom and use that.
 
manimal said:
Ummm.... right. Well, you see, the original poster asked if anyone had any experience with wxWidgets. Since I do, I wrote in and said that I liked it, and that I particularly like using wxWidgets with Dialogblocks. Is this ok? If I implied that what I like is better than what you like, I didn't mean to, and I apologize.
Yep, no problem. That's why I uttered a polite cough when mentioning the Qt Creator designer. I hope that I did not cause any offense :)
 
Last edited by a moderator:
Samurai_Crow said:
Update: The Window Manager used on the Pandora is Matchbox so perhaps you should look there for inspiration. It seems to only have X-Windows as a dependency so it should work really quickly with very little overhead.
Source: the Pandora WIKI
Yeah, Matchbox is cool because since it only really uses X.Org for rendering, it's completely widget system agnostic so you can basically use anything you like with it and it'll look good. Of course, since all widget systems use their own themes, all applications will look out of place when compared to one another, but since Matchbox runs applications fillscreen (not fullscreen ;)), that shouldn't be a problem.

One nice thing about Qt is that there are GTK theme engines available for it, so you can use GTK themes in Qt and make all your Qt apps look like GTK ones (It becomes really difficult to tell them apart), which is really nice for integration. Qt themes cannot be used through GTK, though, without looking ugly (because GTK expects widgets to be rectangular and opaque, and doesn't support pure ARGB rendering, and generally uses a more restrictive drawing process, etc) so no Qt themes for GTK apps :(

Oh and if you, Samurai_Crow, imply that people should be using some widget system based purely on X, then I would beg to differ, because such widget systems tend to look really ugly (Tcl/Tk does not look particularly nice, for example, wouldn't you say?).
 
Last edited by a moderator:
dflemstr said:
Oh and if you, Samurai_Crow, imply that people should be using some widget system based purely on X, then I would beg to differ, because such widget systems tend to look really ugly (Tcl/Tk does not look particularly nice, for example, wouldn't you say?).

Tcl/Tk looks bad. Qt seems to be kind of heavy for a handheld device IMHO unless you statically link it or unless it is already loaded in memory in a .so file. (To OP: In Linux a .so file is the equivalent to a .dll .)
 
Last edited by a moderator:
Samurai_Crow said:
dflemstr said:
Oh and if you, Samurai_Crow, imply that people should be using some widget system based purely on X, then I would beg to differ, because such widget systems tend to look really ugly (Tcl/Tk does not look particularly nice, for example, wouldn't you say?).

Tcl/Tk looks bad. Qt seems to be kind of heavy for a handheld device IMHO unless you statically link it or unless it is already loaded in memory in a .so file. (To OP: In Linux a .so file is the equivalent to a .dll .)
Well, I don't really know about that, since Qt was explicitly designed to be used on handheld devices, and Qt does not consume more memory than GTK+Clutter or a similar setup, so I don't understand why you think that Qt would consume a lot of memory.
 
Last edited by a moderator:
Back
Top