|
-
July 28th, 2009, 02:10 PM
#1
GUI's in C++?
I am really at a loss here.
I have gotten a decent grip on C++ with terminal based programs but how can I make a GUI?
Is there any good GUI programming in C++ tutorials out there?
Dont forget that I am using Linux with GCC. I know there is a huge difference in the way they handle windows and GUI's.
-
July 28th, 2009, 02:13 PM
#2
Re: GUI's in C++?
There are several options. GTK+, WxWidgets, and QT are the most common cross-platform GUI frameworks. They all follow similar paradigms.
-
July 28th, 2009, 02:18 PM
#3
Re: GUI's in C++?
You could consider using a GUI framework, e.g., FLTK, FOX Toolkit, gtkmm, Qt, wxWidgets (and the list goes on).
-
July 28th, 2009, 02:41 PM
#4
Re: GUI's in C++?
This is a bit off topic, but a lot of folks are doing GUI stuff in a high level language as a wrapper around fast C/C++ code. If you are familiar with one of the various scripting languages that have good support for C/C++ calls, that might prove to be a faster way.
-
July 28th, 2009, 03:07 PM
#5
Re: GUI's in C++?
Ok I found out that no matter what I do there is no easy way to compile windows programs with linux gcc.
Is there a GUI kit JUST for linux?
The ones listed above are for both but I would have to recompile the code to make it work on windows anyways so I think that since I am not going to use the windows option I should choose an GUI kit that is just for linux to save download bandwidth and HDD space.
-
July 28th, 2009, 03:23 PM
#6
Re: GUI's in C++?
Most of those are just source based, so...you won't be wasting disk space, except for a few macro defintions and specialized classes/functions. GTK is gnome took kit, I think. It was ported over to windows just to let windows users use the programs.
-
July 28th, 2009, 03:32 PM
#7
Re: GUI's in C++?
 Originally Posted by e_torstenson
GTK is gnome took kit, I think.
GIMP Tool Kit. gtkmm is the official C++ wrapper for GTK+.
-
July 28th, 2009, 03:36 PM
#8
Re: GUI's in C++?
You really should consider more than just the target of Linux.
The quality and support of a framework is at least as important. Consider how much time you'll spend learning any framework (a few months), and ask yourself would you choose to invest that time limited to one OS? Why not invest that time in a framework such that, in the future, you'd be familiar with it on several potential target OS, including Mac?
Qt is recognizably a superior design than many of the other frameworks, and it offers a lot more than just GUI. It works on Linux as well as any other, and the time spent learning it would apply to any target in the future.
That's not the case with GTK+. It may be fairly well designed, but there's a lot more energy in documentation for Qt, and it's design goes well beyond what GTK+ provides. The GTK port for Windows is not exactly stellar.
It's true that you should compile Windows programs on Windows, Mac programs on a Mac - that's simply logical. If you develop with something that's portable anyway, you loose virtually nothing, and gain the ability to be flexible.
I've not been a particular fan of Qt, but it is seriously good work and produces good to excellent results on all target platforms, and that's tough to say about any of the other frameworks (there are no perfect ones).
If my post was interesting or helpful, perhaps you would consider clicking the 'rate this post' to let me know (middle icon of the group in the upper right of the post).
-
July 28th, 2009, 04:06 PM
#9
Re: GUI's in C++?
I can say from personal experience that wxWindows is easy to use for small jobs, but it becomes pretty cumbersome as the project gets bigger. The design very outdated, which is unfortunate. It does work natively on each of the separate platforms-which can't be said of GTK-but I ran into a few gotchas when testing it in windows (which I think is where wxWidgets development is generally done...) A coworker highly recommended QT. If I do another complex GUI, it will either be QT based, or I'll use something higher level and interface to my C++ code.
-
July 28th, 2009, 04:10 PM
#10
Re: GUI's in C++?
 Originally Posted by e_torstenson
It does work natively on each of the separate platforms-which can't be said of GTK
Aside from requiring X11 on OSX, are there any other places GTK is non-native?
-
July 28th, 2009, 04:24 PM
#11
Re: GUI's in C++?
 Originally Posted by Lindley
Aside from requiring X11 on OSX, are there any other places GTK is non-native?
I doubt it, but I really don't know. The X11 isn't a huge issue, but it's worth keeping in mind if you plan to target OSX.
-
July 28th, 2009, 04:25 PM
#12
Re: GUI's in C++?
I would recommend wxWidgets. This gives you an interface that works with Windows, X11, Aqua, GTK...
-
July 28th, 2009, 04:51 PM
#13
Re: GUI's in C++?
wxWidgets was used for the GUI interface for AVG antivirus and FileZilla (I mention those two because you can download them for free to see what the results are like).
The only "gotcha" on Mac targets for wxWidgets is that it uses Carbon as the underlying API. That limits the target to 32bits only, and some of the "exclusive" OSX features aren't automatically supported.
Qt moved the Mac implementation to Cocoa on the Mac, which allows for 64 bit Mac targets and OSX feature support.
If my post was interesting or helpful, perhaps you would consider clicking the 'rate this post' to let me know (middle icon of the group in the upper right of the post).
-
July 28th, 2009, 04:53 PM
#14
Re: GUI's in C++?
WxWidgets also has a Cocoa backend, but it's still experimental at this point.
-
July 28th, 2009, 05:04 PM
#15
Re: GUI's in C++?
The first Cocoa attempts for wxWidgets go back to 2001. It's been in "alpha" ever since.
If my post was interesting or helpful, perhaps you would consider clicking the 'rate this post' to let me know (middle icon of the group in the upper right of the post).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|