ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Im a programmer that has been blinded by Windows ever since I was on computers. I have recently jumped over to Mandrake 9 and am interesting in programming on the linux platform. I know C++ very well, however... I was looking for someplace to start in Linux for GUI programming.
I have read posts about Glade, Qt, OpenGL and maybe even some others... I have heard of them and my problem is that I dont know what role they play. I am familiar with Windows API and was wondering if someone could draw a relation to that to make it clearer? What exactly is Glade and Qt and how do they work? Are they just seperate APIs for GUI programming or are they made for different purposes? Is it like MFC for Windows? There are many more questions, but until I understand the basics, I will save those
Qt and GTK are toolkits (like MFC, probably). Qt is C++ based, when GTK is rather for C (but can ne used with C++). Both Qt and GTK are "over" plain X (you can program in plain Xlib if you wish, but that's harder).
Glade and Qt Designer are tools to design GUI apps. They're graphical and allow you to "draw" windows and so on. Plus they generate code you can include in your program. They're well documented, so you can try hem reading tutorials. Glade is for GTK, Qt Designer is for Qt (that was easy to guess).
Edit: Qt and GTK functionality is similar (well...) to MFC, but the way they work is different. Just try one of them, read basic tutorial and you'll know what I mean.
So is there any advantage to using Qt over GTK or vise-versa? Im very knowledgeable in C++, so should I stick with Qt? Ive seen alot of applications that require GTK.
Thanks for your input Mara. Do you have any recommendations for basic tutorials?
I'm kind of in the same situation. I pretty much know Windows programming inside and out, and am now learning some X programming.
What I've learnd so far is that Xlib is fairly comparable to the Win32 API. But, despite the similarities, there are still enough differences in how things are done to make things challenging. Many of the other libraries seem to provide a higher level abstraction layer to Xlib, the same way MFC, .Net forums, etc. provide a higher level abstraction layer to the Win32 API.
I haven't looked at anything other than Xlib and Xt yet, but I'm guessing that much like learning the Win32 API gives you insight into how MFC et. al. work underneath, learning Xlib would give you insight into how all the higher level libraries for X work underneath.
I saw an MFC program drawing a window and something inside and it was loooooong. In Qt/GTK it's much easier (and shorter). So comparing MFC and Qt/GTK is probably not the best idea.
http://www.ac3.edu.au/SGI_Developer/...b_PG/sgi_html/
id say thats the best xlib tutorial (for some reason theres not much tutorials with exaples, either an explanation, or just the plain functions with no info on how they work
as for GTK vs QT, id take GTK only cuse the apps i like are made for it, but its realy up to you
and if your planing to make any programs with user interfaces then defidently go with a toolkit as that will handle most of the hard stuff for you in dealing with the X windowing system
I would suggest you look into QT, it's a very clean and powerful toolkit (KDE is built on it) and more than just a GUI library. Check the homepage at www.trolltech.com, the online documentation is very extensive!
I do notice that a great deal of apps I use, the requirements always make mention to GTK... I dont see too many apps based on Qt (at least they dont specify it). Is there any particular reason for this? What are some apps that require Qt?
Xlib is a great way to learn about the bowels of X11, but take heed, it is for the true mashochist at heart. It is more accurate to compare Xlib with just the Win32 GDI and window messaging API. You're going to have a much harder time writing Xlib code than Win32. No functions for doing dialog boxes, menus, advanced controls etc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.