How to write GUI program for Linux universe in C++
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.
How to write GUI program for Linux universe in C++
There are various GUI libraries (even cross-platform) for C++. However, I don't really know how does it work in Linux. As far as I know, Linux family has thing called Desktop Environment. And each distro using different DE. So what GUI lib should I choose to allow my GUI app works on all of these DE?
To write GUI apps, you need a widget library. Which one you use depends on what desktop environment you want it to run on. For a Gnome or xfce environment, use gtk2. For a KDE environment, use qt. For a simple window manager, you can use either. In theory, you can also use the Athena widget set Xaw, which was used for the original X apps, but I've heard it's a pig to use. I use gtk myself.
To write GUI apps, you need a widget library. Which one you use depends on what desktop environment you want it to run on. For a Gnome or xfce environment, use gtk2. For a KDE environment, use qt. For a simple window manager, you can use either. In theory, you can also use the Athena widget set Xaw, which was used for the original X apps, but I've heard it's a pig to use. I use gtk myself.
Thanks for the advise. One more question, plz.
Right now I'm using Lubuntu, which has lxde. That means I should use gtk right? Also, if I brought my program to other distro. What will it display? Will it corrupt or display incorrectly? How some app like Firefox can make a matching theme cross-distro?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.